kubernetes-deploy 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5719744341ee174982a0aeec721aca1fac39154
4
- data.tar.gz: 4d705c38c73e5de46b428b2475ad3f2dcc19bd48
3
+ metadata.gz: 6837800094b0b4ab018fd5f293c7b1fae54ab733
4
+ data.tar.gz: 42831de0eeb6024cca35b8c3761361240d0bc479
5
5
  SHA512:
6
- metadata.gz: f97774306df820422fd5fa2cb91408e0f89e50f9e2257b003d1026a80df060db3a7e844b9a806a44b2552c8b4d88d960396f38ac99b87663478b4e6c4f3972ba
7
- data.tar.gz: 85602d28ddb571043f4ab89239b90b6777197ca90c2a37565a78630042507dc98d493e36f0c24fc7b944485892b8a25d0565655a32f38163fb94c223fe858fd4
6
+ metadata.gz: a9d77d3b4285211c41b181840978b7e164880cba555684d14cef1f08756163b3ad35519a6f4d3826f95468bb76d27e680eda3e4e43d2f7868c3baea7b7c5bcd0
7
+ data.tar.gz: f1ef9ce650c57368ecf523972be26056313aedce65ab664692ebb3885264b839fae5f227fe405b3ba5391711675b71abd0a6492a32e22fea5aa7226fdce28bad
@@ -46,18 +46,20 @@ module KubernetesDeploy
46
46
  # core/v1/ReplicationController -- superseded by deployments/replicasets
47
47
  # extensions/v1beta1/ReplicaSet -- managed by deployments
48
48
  # core/v1/Secret -- should not committed / managed by shipit
49
- PRUNE_WHITELIST = %w(
49
+ BASE_PRUNE_WHITELIST = %w(
50
50
  core/v1/ConfigMap
51
51
  core/v1/Pod
52
52
  core/v1/Service
53
53
  batch/v1/Job
54
54
  extensions/v1beta1/DaemonSet
55
55
  extensions/v1beta1/Deployment
56
- extensions/v1beta1/HorizontalPodAutoscaler
57
56
  extensions/v1beta1/Ingress
58
57
  apps/v1beta1/StatefulSet
59
58
  ).freeze
60
59
 
60
+ PRUNE_WHITELIST_V_1_5 = %w(extensions/v1beta1/HorizontalPodAutoscaler).freeze
61
+ PRUNE_WHITELIST_V_1_6 = %w(autoscaling/v1/HorizontalPodAutoscaler).freeze
62
+
61
63
  def self.with_friendly_errors
62
64
  yield
63
65
  rescue FatalDeploymentError => error
@@ -126,6 +128,23 @@ MSG
126
128
 
127
129
  private
128
130
 
131
+ def versioned_prune_whitelist
132
+ if server_major_version == "1.5"
133
+ BASE_PRUNE_WHITELIST + PRUNE_WHITELIST_V_1_5
134
+ else
135
+ BASE_PRUNE_WHITELIST + PRUNE_WHITELIST_V_1_6
136
+ end
137
+ end
138
+
139
+ def server_major_version
140
+ @server_major_version ||= begin
141
+ out, _, _ = run_kubectl('version', '--short')
142
+ matchdata = /Server Version: v(?<version>\d\.\d)/.match(out)
143
+ raise "Could not determine server version" unless matchdata[:version]
144
+ matchdata[:version]
145
+ end
146
+ end
147
+
129
148
  # Inspect the file referenced in the kubectl stderr
130
149
  # to make it easier for developer to understand what's going on
131
150
  def inspect_kubectl_out_for_files(stderr)
@@ -291,7 +310,7 @@ MSG
291
310
 
292
311
  if prune
293
312
  command.push("--prune", "--all")
294
- PRUNE_WHITELIST.each { |type| command.push("--prune-whitelist=#{type}") }
313
+ versioned_prune_whitelist.each { |type| command.push("--prune-whitelist=#{type}") }
295
314
  end
296
315
 
297
316
  _, err, st = run_kubectl(*command)
@@ -1,3 +1,3 @@
1
1
  module KubernetesDeploy
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
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.4.0
4
+ version: 0.4.1
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-03-28 00:00:00.000000000 Z
13
+ date: 2017-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.5.1
155
+ rubygems_version: 2.6.7
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Kubernetes deploy scripts