kubernetes-deploy 0.7.9 → 0.7.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b8cf32243096addf8a356ca3d8f64d616d5ee61
|
4
|
+
data.tar.gz: fcd123cde742c204f23f8092deb5d28d9530656c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aef7c825f53c643fcb30195e91356a068d09d059f80489292770c5c3560bbc2d65688f2b721e0f843317bc6a90d505411bd2dd34b20e9cdc607906ea72e0b3b4
|
7
|
+
data.tar.gz: 4a6d4166ecd0235a322ca80aba55b80f7a75af1ea301a0ca59fd11341f135ef08856b8346a44f6f72f8e7ca1eebbefce22dedbaecf96aebddc8f40be3df324e2
|
@@ -9,6 +9,7 @@ module KubernetesDeploy
|
|
9
9
|
|
10
10
|
if @found
|
11
11
|
deployment_data = JSON.parse(raw_json)
|
12
|
+
@desired_replicas = deployment_data["spec"]["replicas"].to_i
|
12
13
|
@latest_rs = find_latest_rs(deployment_data)
|
13
14
|
@rollout_data = { "replicas" => 0 }.merge(deployment_data["status"]
|
14
15
|
.slice("replicas", "updatedReplicas", "availableReplicas", "unavailableReplicas"))
|
@@ -35,8 +36,8 @@ module KubernetesDeploy
|
|
35
36
|
return false unless @latest_rs
|
36
37
|
|
37
38
|
@latest_rs.deploy_succeeded? &&
|
38
|
-
@latest_rs.desired_replicas == desired_replicas && # latest RS fully scaled up
|
39
|
-
@rollout_data["updatedReplicas"].to_i == @
|
39
|
+
@latest_rs.desired_replicas == @desired_replicas && # latest RS fully scaled up
|
40
|
+
@rollout_data["updatedReplicas"].to_i == @desired_replicas &&
|
40
41
|
@rollout_data["updatedReplicas"].to_i == @rollout_data["availableReplicas"].to_i
|
41
42
|
end
|
42
43
|
|
@@ -52,10 +53,6 @@ module KubernetesDeploy
|
|
52
53
|
@found
|
53
54
|
end
|
54
55
|
|
55
|
-
def desired_replicas
|
56
|
-
@definition["spec"]["replicas"].to_i
|
57
|
-
end
|
58
|
-
|
59
56
|
private
|
60
57
|
|
61
58
|
def find_latest_rs(deployment_data)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
module KubernetesDeploy
|
3
3
|
class ReplicaSet < KubernetesResource
|
4
4
|
TIMEOUT = 5.minutes
|
5
|
+
attr_reader :desired_replicas
|
5
6
|
|
6
7
|
def initialize(namespace:, context:, definition:, logger:, parent: nil, deploy_started: nil)
|
7
8
|
@parent = parent
|
@@ -19,6 +20,7 @@ module KubernetesDeploy
|
|
19
20
|
|
20
21
|
if rs_data.present?
|
21
22
|
@found = true
|
23
|
+
@desired_replicas = rs_data["spec"]["replicas"].to_i
|
22
24
|
@rollout_data = { "replicas" => 0 }.merge(rs_data["status"]
|
23
25
|
.slice("replicas", "availableReplicas", "readyReplicas"))
|
24
26
|
@status = @rollout_data.map { |state_replicas, num| "#{num} #{state_replicas.chop.pluralize(num)}" }.join(", ")
|
@@ -32,8 +34,8 @@ module KubernetesDeploy
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def deploy_succeeded?
|
35
|
-
@
|
36
|
-
@
|
37
|
+
@desired_replicas == @rollout_data["availableReplicas"].to_i &&
|
38
|
+
@desired_replicas == @rollout_data["readyReplicas"].to_i
|
37
39
|
end
|
38
40
|
|
39
41
|
def deploy_failed?
|
@@ -48,10 +50,6 @@ module KubernetesDeploy
|
|
48
50
|
@found
|
49
51
|
end
|
50
52
|
|
51
|
-
def desired_replicas
|
52
|
-
@definition["spec"]["replicas"].to_i
|
53
|
-
end
|
54
|
-
|
55
53
|
def fetch_events
|
56
54
|
own_events = super
|
57
55
|
return own_events unless @pods.present?
|
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.7.
|
4
|
+
version: 0.7.10
|
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: 2017-07-
|
12
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|