kube_cluster 0.4.8 → 0.4.10
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/Gemfile.lock +1 -1
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/helm/chart.rb +28 -1
- data/lib/kube/helm/repo.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd9c2115bfa5725ce20b8f8f7070cd86f4c07b25ac98c1309b1da7c39ec19018
|
|
4
|
+
data.tar.gz: 496da4125cb378a066f9736857bfaa5fdc61061bc56c2707c67ac3c2d2a60762
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07d478e5d0a180861a8ca123adb2a061d954bcf618c550bde8490356c7db25954b7077527430c5e3e5d9cc51628d13c0ee309651ee501dc68c56ed4ce96e93af
|
|
7
|
+
data.tar.gz: 9b434a483506b857aac0e3f78f50fb18af5c7f3567c5b47f9e883fe6dfaf77d490effb4f258b037b57fc114ec74eba48ef417fbfb3d44b63c5354395f464ce26
|
data/Gemfile.lock
CHANGED
data/lib/kube/cluster/version.rb
CHANGED
data/lib/kube/helm/chart.rb
CHANGED
|
@@ -183,11 +183,24 @@ module Kube
|
|
|
183
183
|
|
|
184
184
|
def write_values_tempfile(values)
|
|
185
185
|
tmpfile = Tempfile.new(["helm-values-", ".yaml"])
|
|
186
|
-
tmpfile.write(values.to_yaml)
|
|
186
|
+
tmpfile.write(deep_stringify_keys(values).to_yaml)
|
|
187
187
|
tmpfile.flush
|
|
188
188
|
tmpfile
|
|
189
189
|
end
|
|
190
190
|
|
|
191
|
+
def deep_stringify_keys(obj)
|
|
192
|
+
case obj
|
|
193
|
+
when Hash
|
|
194
|
+
obj.each_with_object({}) do |(k, v), result|
|
|
195
|
+
result[k.to_s] = deep_stringify_keys(v)
|
|
196
|
+
end
|
|
197
|
+
when Array
|
|
198
|
+
obj.map { |v| deep_stringify_keys(v) }
|
|
199
|
+
else
|
|
200
|
+
obj
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
191
204
|
def deep_symbolize_keys(obj)
|
|
192
205
|
case obj
|
|
193
206
|
when Hash
|
|
@@ -393,6 +406,20 @@ test do
|
|
|
393
406
|
end
|
|
394
407
|
end
|
|
395
408
|
|
|
409
|
+
it "apply_values_stringifies_symbol_keys_in_values_file" do
|
|
410
|
+
Dir.mktmpdir do |dir|
|
|
411
|
+
File.write(File.join(dir, "Chart.yaml"), { "name" => "my-app", "version" => "1.0.0" }.to_yaml)
|
|
412
|
+
chart = Kube::Helm::Chart.open(dir)
|
|
413
|
+
|
|
414
|
+
tmpfile = chart.send(:write_values_tempfile, { k8sDistribution: "k3s", nested: { setup: [] } })
|
|
415
|
+
contents = File.read(tmpfile.path)
|
|
416
|
+
contents.should.include "k8sDistribution"
|
|
417
|
+
contents.should.not.include ":k8sDistribution"
|
|
418
|
+
contents.should.include "nested"
|
|
419
|
+
contents.should.not.include ":nested"
|
|
420
|
+
end
|
|
421
|
+
end
|
|
422
|
+
|
|
396
423
|
# ── show_values ──────────────────────────────────────────────────────
|
|
397
424
|
|
|
398
425
|
it "show_values" do
|
data/lib/kube/helm/repo.rb
CHANGED
|
@@ -48,8 +48,10 @@ module Kube
|
|
|
48
48
|
def add
|
|
49
49
|
tap do
|
|
50
50
|
if endpoint.requires_add?
|
|
51
|
+
name = @name
|
|
52
|
+
url = endpoint.url
|
|
51
53
|
helm.run(
|
|
52
|
-
helm.call { repo.add.(
|
|
54
|
+
helm.call { repo.add.(name).(url) }.to_s
|
|
53
55
|
)
|
|
54
56
|
end
|
|
55
57
|
end
|
|
@@ -62,8 +64,9 @@ module Kube
|
|
|
62
64
|
def update
|
|
63
65
|
tap do
|
|
64
66
|
if endpoint.requires_add?
|
|
67
|
+
name = @name
|
|
65
68
|
helm.run(
|
|
66
|
-
helm.call { repo.update.(
|
|
69
|
+
helm.call { repo.update.(name) }.to_s
|
|
67
70
|
)
|
|
68
71
|
end
|
|
69
72
|
end
|
|
@@ -76,8 +79,9 @@ module Kube
|
|
|
76
79
|
def remove
|
|
77
80
|
tap do
|
|
78
81
|
if endpoint.requires_add?
|
|
82
|
+
name = @name
|
|
79
83
|
helm.run(
|
|
80
|
-
helm.call { repo.remove.(
|
|
84
|
+
helm.call { repo.remove.(name) }.to_s
|
|
81
85
|
)
|
|
82
86
|
end
|
|
83
87
|
end
|