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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7991ac5b3de51ea24a9f2db1da671d5ea8e89e40
4
- data.tar.gz: 64c593a2d621275fa402fde1c27b7ed2b13f48d9
3
+ metadata.gz: b6813a027a20fd297012d9fbe53f9bf79ee711f4
4
+ data.tar.gz: 68678d68902d9360939bf247844d7baa59bbe750
5
5
  SHA512:
6
- metadata.gz: 2239c59b22d1f67a7475dedf69dc83a56a3cc2cb06940fed9d22818cdbccf315cf71ea25461d753382b3c3aa8eb94a45de54268218ec920e28276f5cfddfef26
7
- data.tar.gz: eb7d61a8506fd22cf3bd3ce82b4d3edd357c1c28395b481c3c838e2045a8f01163150439300c67b3dd89846fad4a432138ec119f6b36ceef06549c219aa9d33a
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)
@@ -1,3 +1,3 @@
1
1
  module KubernetesDeploy
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-02 00:00:00.000000000 Z
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.1
119
+ rubygems_version: 2.5.2
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Kubernetes deploy scripts