configgin 0.18.5 → 0.18.6
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/lib/configgin/version.rb +1 -1
- data/lib/kube_link_generator.rb +16 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc528a1d36d40fe72247b3e3073688e547791003baa85424cc35d44aec9a3e1c
|
4
|
+
data.tar.gz: 5a41e35ef7694ac29fb92128a911926091f5eaea365025ae6f1552dba635bfcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 905fecc03d4e54c40185ebc7b589f1a01dfd728c3b59e5638cd73c8f49d256f83600c2a5c5cb695d4885f71a5f782c3e7200aa7066156f736290f200265b212d
|
7
|
+
data.tar.gz: 7da7ec67c54d3636a3460d40df4212118f8d62451e45f5e301cbcc4f24b0bd25bd006285ebf91a08a62eca63978e3f11f1c11aeb5646786af98521d040720719
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
configgin (0.18.
|
4
|
+
configgin (0.18.6)
|
5
5
|
bosh-template (~> 2.0)
|
6
6
|
deep_merge (~> 1.1)
|
7
7
|
kubeclient (~> 2.0)
|
@@ -113,7 +113,7 @@ GEM
|
|
113
113
|
thor (0.20.0)
|
114
114
|
unf (0.1.4)
|
115
115
|
unf_ext
|
116
|
-
unf_ext (0.0.7.
|
116
|
+
unf_ext (0.0.7.6)
|
117
117
|
unicode-display_width (1.4.0)
|
118
118
|
|
119
119
|
PLATFORMS
|
data/lib/configgin/version.rb
CHANGED
data/lib/kube_link_generator.rb
CHANGED
@@ -38,16 +38,29 @@ class KubeLinkSpecs
|
|
38
38
|
index.chars.map { |c| chars.index(c) }.reduce(0) { |v, c| v * chars.length + c }
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
42
|
-
|
41
|
+
def _get_image_for_pod_spec(pod_spec)
|
42
|
+
pod_spec.containers.map(&:image).sort.join("\n")
|
43
|
+
end
|
44
|
+
|
45
|
+
def _get_sts_image_for_role(role_name)
|
46
|
+
statefulset = @client_stateful_set.get_stateful_set(role_name, namespace)
|
47
|
+
_get_image_for_pod_spec statefulset.spec.template.spec
|
48
|
+
end
|
49
|
+
|
50
|
+
def _get_pods_for_role(role_name, sts_image)
|
51
|
+
client
|
52
|
+
.get_pods(namespace: namespace, label_selector: "app.kubernetes.io/component=#{role_name}")
|
53
|
+
.select { |pod| _get_image_for_pod_spec(pod.spec) == sts_image }
|
43
54
|
end
|
44
55
|
|
45
56
|
def get_pods_for_role(role_name, job, options = {})
|
57
|
+
sts_image = _get_sts_image_for_role(role_name)
|
58
|
+
|
46
59
|
loop do
|
47
60
|
# The 30.times loop exists to print out status messages
|
48
61
|
30.times do
|
49
62
|
1.times do
|
50
|
-
pods = _get_pods_for_role(role_name)
|
63
|
+
pods = _get_pods_for_role(role_name, sts_image)
|
51
64
|
good_pods = pods.select do |pod|
|
52
65
|
next false unless pod.status.podIP
|
53
66
|
next true if pod.metadata.annotations["skiff-exported-properties-#{job}"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configgin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SUSE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -181,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
|
185
|
-
rubygems_version: 2.7.6
|
184
|
+
rubygems_version: 3.0.3
|
186
185
|
signing_key:
|
187
186
|
specification_version: 4
|
188
187
|
summary: A simple cli app in Ruby to generate configurations using BOSH ERB templates
|