kubernetes-deploy 0.20.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/exe/kubernetes-deploy +1 -1
- data/kubernetes-deploy.gemspec +1 -2
- data/lib/kubernetes-deploy/deploy_task.rb +1 -0
- data/lib/kubernetes-deploy/errors.rb +3 -2
- data/lib/kubernetes-deploy/kubernetes_resource.rb +3 -1
- data/lib/kubernetes-deploy/kubernetes_resource/daemon_set.rb +2 -2
- data/lib/kubernetes-deploy/kubernetes_resource/deployment.rb +1 -0
- data/lib/kubernetes-deploy/restart_task.rb +4 -4
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1da3f74a75f658fb3fd6e31e3ba0a8aa113ad6a
|
4
|
+
data.tar.gz: f3d779d8ced5cb12260e039c47bdd9cf8106ce83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b29bb17f2c20c7c1353f57458c159c63c620f085bb7e0769a0565096c831c7503b92789ac7c7f36118e22cd41f49b0ce0e41392230bee85ac79a2230095cff2
|
7
|
+
data.tar.gz: c875779d47150ba2cd8c784622232651c029ec8a8c411d60763e2a73123c4b1d37d62afc801055dd9fac311e8722415f6c12ab9997592c5595eb7c994b024e7b
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
### Master
|
2
2
|
|
3
|
+
### 0.20.1
|
3
4
|
*Features*
|
4
5
|
|
5
6
|
*Bug Fixes*
|
7
|
+
- Display a nice error instead of crashing when a YAML document is missing 'Kind'
|
8
|
+
([#280](https://github.com/Shopify/kubernetes-deploy/pull/280))
|
9
|
+
- Prevent DaemonSet from succeeding before rollout finishes
|
10
|
+
([#288](https://github.com/Shopify/kubernetes-deploy/issues/288))
|
6
11
|
|
7
12
|
*Enhancements*
|
13
|
+
- Merge multiple `--bindings` arguments, to allow a composite bindings map (multiple arguments or files)
|
8
14
|
|
9
15
|
### 0.20.0
|
10
16
|
|
data/exe/kubernetes-deploy
CHANGED
@@ -15,7 +15,7 @@ max_watch_seconds = nil
|
|
15
15
|
ARGV.options do |opts|
|
16
16
|
opts.on("--bindings=BINDINGS", "Expose additional variables to ERB templates " \
|
17
17
|
"(format: k1=v1,k2=v2, JSON string or file (JSON or YAML) path prefixed by '@')") do |binds|
|
18
|
-
bindings
|
18
|
+
bindings.merge!(KubernetesDeploy::BindingsParser.parse(binds))
|
19
19
|
end
|
20
20
|
|
21
21
|
opts.on("--skip-wait", "Skip verification of non-priority-resource success (not recommended)") { skip_wait = true }
|
data/kubernetes-deploy.gemspec
CHANGED
@@ -24,8 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.required_ruby_version = '>= 2.3.0'
|
26
26
|
spec.add_dependency "activesupport", ">= 5.0"
|
27
|
-
spec.add_dependency "kubeclient", "~>
|
28
|
-
spec.add_dependency "rest-client", ">= 1.7" # Minimum required by kubeclient. Remove when kubeclient releases v3.0.
|
27
|
+
spec.add_dependency "kubeclient", "~> 3.0"
|
29
28
|
spec.add_dependency "googleauth", ">= 0.5"
|
30
29
|
spec.add_dependency "ejson", "1.0.1"
|
31
30
|
spec.add_dependency "colorize", "~> 0.8"
|
@@ -253,6 +253,7 @@ module KubernetesDeploy
|
|
253
253
|
yield doc
|
254
254
|
end
|
255
255
|
rescue InvalidTemplateError => e
|
256
|
+
e.filename ||= filename
|
256
257
|
record_invalid_template(err: e.message, filename: e.filename, content: e.content)
|
257
258
|
raise FatalDeploymentError, "Failed to render and parse template"
|
258
259
|
rescue Psych::SyntaxError => e
|
@@ -4,8 +4,9 @@ module KubernetesDeploy
|
|
4
4
|
class KubectlError < StandardError; end
|
5
5
|
|
6
6
|
class InvalidTemplateError < FatalDeploymentError
|
7
|
-
attr_reader :
|
8
|
-
|
7
|
+
attr_reader :content
|
8
|
+
attr_accessor :filename
|
9
|
+
def initialize(err, filename: nil, content: nil)
|
9
10
|
@filename = filename
|
10
11
|
@content = content
|
11
12
|
super(err)
|
@@ -31,7 +31,9 @@ module KubernetesDeploy
|
|
31
31
|
def build(namespace:, context:, definition:, logger:, statsd_tags:)
|
32
32
|
opts = { namespace: namespace, context: context, definition: definition, logger: logger,
|
33
33
|
statsd_tags: statsd_tags }
|
34
|
-
if
|
34
|
+
if definition["kind"].blank?
|
35
|
+
raise InvalidTemplateError.new("Template missing 'Kind'", content: definition.to_yaml)
|
36
|
+
elsif KubernetesDeploy.const_defined?(definition["kind"])
|
35
37
|
klass = KubernetesDeploy.const_get(definition["kind"])
|
36
38
|
klass.new(**opts)
|
37
39
|
else
|
@@ -18,7 +18,7 @@ module KubernetesDeploy
|
|
18
18
|
|
19
19
|
def deploy_succeeded?
|
20
20
|
return false unless exists?
|
21
|
-
rollout_data["desiredNumberScheduled"].to_i == rollout_data["
|
21
|
+
rollout_data["desiredNumberScheduled"].to_i == rollout_data["updatedNumberScheduled"].to_i &&
|
22
22
|
rollout_data["desiredNumberScheduled"].to_i == rollout_data["numberReady"].to_i &&
|
23
23
|
current_generation == observed_generation
|
24
24
|
end
|
@@ -48,7 +48,7 @@ module KubernetesDeploy
|
|
48
48
|
def rollout_data
|
49
49
|
return { "currentNumberScheduled" => 0 } unless exists?
|
50
50
|
@instance_data["status"]
|
51
|
-
.slice("
|
51
|
+
.slice("updatedNumberScheduled", "desiredNumberScheduled", "numberReady")
|
52
52
|
end
|
53
53
|
|
54
54
|
def parent_of_pod?(pod_data)
|
@@ -131,11 +131,11 @@ module KubernetesDeploy
|
|
131
131
|
|
132
132
|
def patch_kubeclient_deployments(deployments)
|
133
133
|
deployments.each do |record|
|
134
|
-
|
135
|
-
|
134
|
+
begin
|
135
|
+
patch_deployment_with_restart(record)
|
136
136
|
@logger.info "Triggered `#{record.metadata.name}` restart"
|
137
|
-
|
138
|
-
raise RestartAPIError.new(record.metadata.name,
|
137
|
+
rescue Kubeclient::ResourceNotFoundError, Kubeclient::HttpError => e
|
138
|
+
raise RestartAPIError.new(record.metadata.name, e.message)
|
139
139
|
end
|
140
140
|
end
|
141
141
|
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.20.
|
4
|
+
version: 0.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Verey
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -31,28 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '3.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: rest-client
|
44
|
-
requirement: !ruby/object:Gem::Requirement
|
45
|
-
requirements:
|
46
|
-
- - ">="
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '1.7'
|
49
|
-
type: :runtime
|
50
|
-
prerelease: false
|
51
|
-
version_requirements: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ">="
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '1.7'
|
41
|
+
version: '3.0'
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
43
|
name: googleauth
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|