kubernetes-deploy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kubernetes-deploy/runner.rb +6 -7
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6813a027a20fd297012d9fbe53f9bf79ee711f4
|
4
|
+
data.tar.gz: 68678d68902d9360939bf247844d7baa59bbe750
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43316a28fb61923fd1ea2fb2e623cc60d6793d98f71dd8f6380a3758eb5701a789efdd264a2c858a74e062fe698eb9a79f46415ed095757d0163652d3aa99887
|
7
|
+
data.tar.gz: 41e6622be8c17256ff4a8e663fdaa340b4d87c9e727378a53caf29444b8e3e579c81302d7b7656f74ed6986c6051979df99fde329906377c1e28ec0684e7173a
|
@@ -264,17 +264,13 @@ MSG
|
|
264
264
|
end
|
265
265
|
|
266
266
|
def set_kubectl_context
|
267
|
-
out, err, st = run_kubectl("config", "get-contexts", "-o", "name", namespaced: false)
|
267
|
+
out, err, st = run_kubectl("config", "get-contexts", "-o", "name", namespaced: false, with_context: false)
|
268
268
|
available_contexts = out.split("\n")
|
269
269
|
if !st.success?
|
270
270
|
raise FatalDeploymentError, err
|
271
271
|
elsif !available_contexts.include?(@context)
|
272
272
|
raise FatalDeploymentError, "Context #{@context} is not available. Valid contexts: #{available_contexts}"
|
273
273
|
end
|
274
|
-
|
275
|
-
_, err, st = run_kubectl("config", "use-context", @context, namespaced: false)
|
276
|
-
raise FatalDeploymentError, "Kubectl config is not valid: #{err}" unless st.success?
|
277
|
-
KubernetesDeploy.logger.info("Kubectl configured to use context #{@context}")
|
278
274
|
end
|
279
275
|
|
280
276
|
def validate_namespace
|
@@ -283,12 +279,15 @@ MSG
|
|
283
279
|
KubernetesDeploy.logger.info("Namespace #{@namespace} validated")
|
284
280
|
end
|
285
281
|
|
286
|
-
def run_kubectl(*args, namespaced: true)
|
282
|
+
def run_kubectl(*args, namespaced: true, with_context: true)
|
287
283
|
args = args.unshift("kubectl")
|
288
284
|
if namespaced
|
289
|
-
raise FatalDeploymentError, "Namespace missing for namespaced command" unless @namespace
|
290
285
|
args.push("--namespace=#{@namespace}")
|
291
286
|
end
|
287
|
+
|
288
|
+
if with_context
|
289
|
+
args.push("--context=#{@context}")
|
290
|
+
end
|
292
291
|
KubernetesDeploy.logger.debug Shellwords.join(args)
|
293
292
|
out, err, st = Open3.capture3(*args)
|
294
293
|
KubernetesDeploy.logger.debug(out.shellescape)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubernetes-deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kir Shatrov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02-
|
13
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.5.
|
119
|
+
rubygems_version: 2.5.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 4
|
122
122
|
summary: Kubernetes deploy scripts
|