kube_cluster 0.3.8 → 0.3.9
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 +9 -5
- data/Rakefile +1 -1
- data/bin/test +2 -15
- data/kube_cluster.gemspec +3 -2
- data/lib/kube/cluster/manifest.rb +160 -193
- data/lib/kube/cluster/middleware/annotations.rb +43 -51
- data/lib/kube/cluster/middleware/hpa_for_deployment.rb +136 -158
- data/lib/kube/cluster/middleware/ingress_for_service.rb +84 -110
- data/lib/kube/cluster/middleware/labels.rb +60 -73
- data/lib/kube/cluster/middleware/namespace.rb +49 -55
- data/lib/kube/cluster/middleware/pod_anti_affinity.rb +102 -113
- data/lib/kube/cluster/middleware/resource_preset.rb +145 -169
- data/lib/kube/cluster/middleware/security_context.rb +127 -154
- data/lib/kube/cluster/middleware/service_for_deployment.rb +123 -146
- data/lib/kube/cluster/resource/dirty_tracking.rb +328 -418
- data/lib/kube/cluster/version.rb +1 -1
- data/lib/kube/cluster.rb +4 -9
- data/lib/kube/helm/chart.rb +326 -325
- data/lib/kube/helm/endpoint.rb +59 -65
- data/lib/kube/helm/repo.rb +159 -166
- metadata +7 -7
data/lib/kube/helm/endpoint.rb
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require "kube/cluster"
|
|
6
|
-
end
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
7
5
|
|
|
8
6
|
module Kube
|
|
9
7
|
module Helm
|
|
@@ -79,83 +77,79 @@ module Kube
|
|
|
79
77
|
end
|
|
80
78
|
end
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class EndpointTest < Minitest::Test
|
|
86
|
-
# ── OCI detection ──────────────────────────────────────────────────────
|
|
80
|
+
test do
|
|
81
|
+
# ── OCI detection ──────────────────────────────────────────────────────
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
it "oci_endpoint_detected" do
|
|
84
|
+
endpoint = Kube::Helm::Endpoint.new("oci://ghcr.io/my-org/charts")
|
|
85
|
+
endpoint.oci?.should.be.true
|
|
86
|
+
end
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
it "http_endpoint_not_oci" do
|
|
89
|
+
endpoint = Kube::Helm::Endpoint.new("https://charts.bitnami.com/bitnami")
|
|
90
|
+
endpoint.oci?.should.be.false
|
|
91
|
+
end
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
# ── requires_add? ─────────────────────────────────────────────────────
|
|
99
94
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
95
|
+
it "oci_does_not_require_add" do
|
|
96
|
+
endpoint = Kube::Helm::Endpoint.new("oci://ghcr.io/my-org/charts")
|
|
97
|
+
endpoint.requires_add?.should.be.false
|
|
98
|
+
end
|
|
104
99
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
it "http_requires_add" do
|
|
101
|
+
endpoint = Kube::Helm::Endpoint.new("https://charts.bitnami.com/bitnami")
|
|
102
|
+
endpoint.requires_add?.should.be.true
|
|
103
|
+
end
|
|
109
104
|
|
|
110
|
-
|
|
105
|
+
# ── chart_ref ──────────────────────────────────────────────────────────
|
|
111
106
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
it "oci_chart_ref" do
|
|
108
|
+
endpoint = Kube::Helm::Endpoint.new("oci://ghcr.io/my-org/charts")
|
|
109
|
+
endpoint.chart_ref("nginx").should == "oci://ghcr.io/my-org/charts/nginx"
|
|
110
|
+
end
|
|
116
111
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
it "oci_chart_ref_strips_trailing_slash" do
|
|
113
|
+
endpoint = Kube::Helm::Endpoint.new("oci://ghcr.io/my-org/charts/")
|
|
114
|
+
endpoint.chart_ref("nginx").should == "oci://ghcr.io/my-org/charts/nginx"
|
|
115
|
+
end
|
|
121
116
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
it "http_chart_ref_with_repo_name" do
|
|
118
|
+
endpoint = Kube::Helm::Endpoint.new("https://charts.bitnami.com/bitnami")
|
|
119
|
+
endpoint.chart_ref("nginx", repo_name: "bitnami").should == "bitnami/nginx"
|
|
120
|
+
end
|
|
126
121
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
it "http_chart_ref_raises_without_repo_name" do
|
|
123
|
+
endpoint = Kube::Helm::Endpoint.new("https://charts.bitnami.com/bitnami")
|
|
124
|
+
lambda { endpoint.chart_ref("nginx") }.should.raise ArgumentError
|
|
125
|
+
end
|
|
131
126
|
|
|
132
|
-
|
|
127
|
+
# ── validation ─────────────────────────────────────────────────────────
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
it "raises_on_empty_url" do
|
|
130
|
+
lambda { Kube::Helm::Endpoint.new("") }.should.raise ArgumentError
|
|
131
|
+
end
|
|
137
132
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
it "raises_on_non_string_url" do
|
|
134
|
+
lambda { Kube::Helm::Endpoint.new(nil) }.should.raise ArgumentError
|
|
135
|
+
end
|
|
141
136
|
|
|
142
|
-
|
|
137
|
+
# ── to_s / equality ───────────────────────────────────────────────────
|
|
143
138
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
it "to_s_returns_url" do
|
|
140
|
+
endpoint = Kube::Helm::Endpoint.new("https://charts.example.com")
|
|
141
|
+
endpoint.to_s.should == "https://charts.example.com"
|
|
142
|
+
end
|
|
148
143
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
it "equality" do
|
|
145
|
+
a = Kube::Helm::Endpoint.new("https://charts.example.com")
|
|
146
|
+
b = Kube::Helm::Endpoint.new("https://charts.example.com")
|
|
147
|
+
a.should == b
|
|
148
|
+
end
|
|
154
149
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
end
|
|
150
|
+
it "inequality" do
|
|
151
|
+
a = Kube::Helm::Endpoint.new("https://charts.example.com")
|
|
152
|
+
b = Kube::Helm::Endpoint.new("oci://ghcr.io/my-org/charts")
|
|
153
|
+
a.should.not == b
|
|
160
154
|
end
|
|
161
155
|
end
|
data/lib/kube/helm/repo.rb
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require "kube/cluster"
|
|
6
|
-
end
|
|
7
|
-
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "kube/cluster"
|
|
8
5
|
require_relative "endpoint"
|
|
9
6
|
require_relative "chart"
|
|
10
7
|
|
|
@@ -125,200 +122,196 @@ module Kube
|
|
|
125
122
|
end
|
|
126
123
|
end
|
|
127
124
|
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
test do
|
|
126
|
+
# ── initialization ────────────────────────────────────────────────────
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
it "initializes_with_name_and_url" do
|
|
129
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
130
|
+
repo.name.should == "bitnami"
|
|
131
|
+
end
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
end
|
|
133
|
+
it "raises_on_empty_name" do
|
|
134
|
+
lambda {
|
|
135
|
+
Kube::Helm::Repo.new("", url: "https://charts.example.com")
|
|
136
|
+
}.should.raise ArgumentError
|
|
137
|
+
end
|
|
140
138
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
it "raises_on_nil_name" do
|
|
140
|
+
lambda {
|
|
141
|
+
Kube::Helm::Repo.new(nil, url: "https://charts.example.com")
|
|
142
|
+
}.should.raise ArgumentError
|
|
143
|
+
end
|
|
146
144
|
|
|
147
|
-
|
|
148
|
-
assert_raises(ArgumentError) do
|
|
149
|
-
Kube::Helm::Repo.new(nil, url: "https://charts.example.com")
|
|
150
|
-
end
|
|
151
|
-
end
|
|
145
|
+
# ── oci? delegation ──────────────────────────────────────────────────
|
|
152
146
|
|
|
153
|
-
|
|
147
|
+
it "oci_returns_true_for_oci_url" do
|
|
148
|
+
repo = Kube::Helm::Repo.new("ghcr", url: "oci://ghcr.io/my-org/charts")
|
|
149
|
+
repo.oci?.should.be.true
|
|
150
|
+
end
|
|
154
151
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
it "oci_returns_false_for_http_url" do
|
|
153
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
154
|
+
repo.oci?.should.be.false
|
|
155
|
+
end
|
|
159
156
|
|
|
160
|
-
|
|
161
|
-
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
162
|
-
refute repo.oci?
|
|
163
|
-
end
|
|
157
|
+
# ── add / update / remove ────────────────────────────────────────────
|
|
164
158
|
|
|
165
|
-
|
|
159
|
+
it "add_returns_self_for_oci" do
|
|
160
|
+
repo = Kube::Helm::Repo.new("ghcr", url: "oci://ghcr.io/my-org/charts")
|
|
161
|
+
repo.add.should == repo
|
|
162
|
+
end
|
|
166
163
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
it "update_returns_self_for_oci" do
|
|
165
|
+
repo = Kube::Helm::Repo.new("ghcr", url: "oci://ghcr.io/my-org/charts")
|
|
166
|
+
repo.update.should == repo
|
|
167
|
+
end
|
|
171
168
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
169
|
+
it "remove_returns_self_for_oci" do
|
|
170
|
+
repo = Kube::Helm::Repo.new("ghcr", url: "oci://ghcr.io/my-org/charts")
|
|
171
|
+
repo.remove.should == repo
|
|
172
|
+
end
|
|
176
173
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
it "add_runs_helm_repo_add" do
|
|
175
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
176
|
+
|
|
177
|
+
captured_cmd = nil
|
|
178
|
+
original = Kube::Helm.method(:run)
|
|
179
|
+
Kube::Helm.define_singleton_method(:run) { |cmd| captured_cmd = cmd; "" }
|
|
180
|
+
begin
|
|
181
|
+
result = repo.add
|
|
182
|
+
result.should == repo
|
|
183
|
+
ensure
|
|
184
|
+
Kube::Helm.define_singleton_method(:run, original)
|
|
180
185
|
end
|
|
186
|
+
end
|
|
181
187
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
captured_cmd = nil
|
|
186
|
-
Kube::Helm.stub(:run, ->(cmd) { captured_cmd = cmd; "" }) do
|
|
187
|
-
result = repo.add
|
|
188
|
-
assert_equal repo, result
|
|
189
|
-
end
|
|
188
|
+
it "update_runs_helm_repo_update" do
|
|
189
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
captured_cmd = nil
|
|
192
|
+
original = Kube::Helm.method(:run)
|
|
193
|
+
Kube::Helm.define_singleton_method(:run) { |cmd| captured_cmd = cmd; "" }
|
|
194
|
+
begin
|
|
195
|
+
repo.update
|
|
196
|
+
ensure
|
|
197
|
+
Kube::Helm.define_singleton_method(:run, original)
|
|
195
198
|
end
|
|
196
199
|
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
captured_cmd.should.include "update"
|
|
201
|
+
end
|
|
199
202
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
repo.update
|
|
203
|
-
end
|
|
203
|
+
it "remove_runs_helm_repo_remove" do
|
|
204
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
captured_cmd = nil
|
|
207
|
+
original = Kube::Helm.method(:run)
|
|
208
|
+
Kube::Helm.define_singleton_method(:run) { |cmd| captured_cmd = cmd; "" }
|
|
209
|
+
begin
|
|
210
|
+
repo.remove
|
|
211
|
+
ensure
|
|
212
|
+
Kube::Helm.define_singleton_method(:run, original)
|
|
208
213
|
end
|
|
209
214
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
captured_cmd = nil
|
|
214
|
-
Kube::Helm.stub(:run, ->(cmd) { captured_cmd = cmd; "" }) do
|
|
215
|
-
repo.remove
|
|
216
|
-
end
|
|
215
|
+
captured_cmd.should.include "remove"
|
|
216
|
+
end
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
# ── fetch ────────────────────────────────────────────────────────────
|
|
219
|
+
|
|
220
|
+
it "fetch_returns_chart_with_metadata" do
|
|
221
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
222
|
+
|
|
223
|
+
stub_chart_yaml = {
|
|
224
|
+
"name" => "nginx",
|
|
225
|
+
"version" => "18.1.0",
|
|
226
|
+
"appVersion" => "1.25.0",
|
|
227
|
+
}.to_yaml
|
|
228
|
+
|
|
229
|
+
captured_cmds = []
|
|
230
|
+
original = Kube::Helm.method(:run)
|
|
231
|
+
Kube::Helm.define_singleton_method(:run) { |cmd|
|
|
232
|
+
captured_cmds << cmd
|
|
233
|
+
cmd.include?("show") ? stub_chart_yaml : ""
|
|
234
|
+
}
|
|
235
|
+
begin
|
|
236
|
+
chart = repo.fetch("nginx", version: "18.1.0")
|
|
237
|
+
chart.name.should == "nginx"
|
|
238
|
+
ensure
|
|
239
|
+
Kube::Helm.define_singleton_method(:run, original)
|
|
221
240
|
end
|
|
241
|
+
end
|
|
222
242
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
chart = repo.fetch("nginx", version: "18.1.0")
|
|
240
|
-
|
|
241
|
-
assert_instance_of Kube::Helm::Chart, chart
|
|
242
|
-
assert_equal "nginx", chart.name
|
|
243
|
-
assert_equal "18.1.0", chart.version
|
|
244
|
-
assert_equal "1.25.0", chart.app_version
|
|
245
|
-
assert_equal "bitnami/nginx", chart.ref
|
|
246
|
-
assert_nil chart.path
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
# Should have run: repo add, repo update, show chart
|
|
250
|
-
show_cmd = captured_cmds.find { |c| c.include?("show") && c.include?("chart") }
|
|
251
|
-
assert show_cmd, "Expected a show chart command"
|
|
252
|
-
assert_includes show_cmd, "bitnami/nginx"
|
|
253
|
-
assert_includes show_cmd, "--version=18.1.0"
|
|
243
|
+
it "fetch_without_version" do
|
|
244
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
245
|
+
|
|
246
|
+
stub_chart_yaml = { "name" => "nginx", "version" => "18.1.0" }.to_yaml
|
|
247
|
+
|
|
248
|
+
captured_cmds = []
|
|
249
|
+
original = Kube::Helm.method(:run)
|
|
250
|
+
Kube::Helm.define_singleton_method(:run) { |cmd|
|
|
251
|
+
captured_cmds << cmd
|
|
252
|
+
cmd.include?("show") ? stub_chart_yaml : ""
|
|
253
|
+
}
|
|
254
|
+
begin
|
|
255
|
+
chart = repo.fetch("nginx")
|
|
256
|
+
chart.should.be.instance_of Kube::Helm::Chart
|
|
257
|
+
ensure
|
|
258
|
+
Kube::Helm.define_singleton_method(:run, original)
|
|
254
259
|
end
|
|
260
|
+
end
|
|
255
261
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
refute_includes show_cmd, "--version"
|
|
262
|
+
it "fetch_propagates_cluster" do
|
|
263
|
+
cluster = Kube::Cluster.connect(kubeconfig: "/tmp/test-kubeconfig")
|
|
264
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami", cluster: cluster)
|
|
265
|
+
|
|
266
|
+
stub_chart_yaml = { "name" => "nginx", "version" => "18.1.0" }.to_yaml
|
|
267
|
+
|
|
268
|
+
helm = cluster.connection.helm
|
|
269
|
+
original = helm.method(:run)
|
|
270
|
+
helm.define_singleton_method(:run) { |cmd|
|
|
271
|
+
cmd.include?("show") ? stub_chart_yaml : ""
|
|
272
|
+
}
|
|
273
|
+
begin
|
|
274
|
+
chart = repo.fetch("nginx", version: "18.1.0")
|
|
275
|
+
chart.cluster.should == cluster
|
|
276
|
+
ensure
|
|
277
|
+
helm.define_singleton_method(:run, original)
|
|
273
278
|
end
|
|
279
|
+
end
|
|
274
280
|
|
|
275
|
-
|
|
276
|
-
cluster = Kube::Cluster.connect(kubeconfig: "/tmp/test-kubeconfig")
|
|
277
|
-
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami", cluster: cluster)
|
|
278
|
-
|
|
279
|
-
stub_chart_yaml = { "name" => "nginx", "version" => "18.1.0" }.to_yaml
|
|
280
|
-
|
|
281
|
-
cluster.connection.helm.stub(:run, ->(cmd) {
|
|
282
|
-
cmd.include?("show") ? stub_chart_yaml : ""
|
|
283
|
-
}) do
|
|
284
|
-
chart = repo.fetch("nginx", version: "18.1.0")
|
|
285
|
-
assert_equal cluster, chart.cluster
|
|
286
|
-
assert_equal "bitnami/nginx", chart.ref
|
|
287
|
-
end
|
|
288
|
-
end
|
|
281
|
+
# ── cluster scoping ──────────────────────────────────────────────────
|
|
289
282
|
|
|
290
|
-
|
|
283
|
+
it "initializes_without_cluster" do
|
|
284
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
285
|
+
repo.cluster.should.be.nil
|
|
286
|
+
end
|
|
291
287
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
288
|
+
it "initializes_with_cluster" do
|
|
289
|
+
cluster = Kube::Cluster.connect(kubeconfig: "/tmp/test-kubeconfig")
|
|
290
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami", cluster: cluster)
|
|
291
|
+
repo.cluster.should == cluster
|
|
292
|
+
end
|
|
296
293
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
it "add_uses_cluster_helm_instance" do
|
|
295
|
+
cluster = Kube::Cluster.connect(kubeconfig: "/tmp/test-kubeconfig")
|
|
296
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami", cluster: cluster)
|
|
297
|
+
|
|
298
|
+
captured_cmd = nil
|
|
299
|
+
helm = cluster.connection.helm
|
|
300
|
+
original = helm.method(:run)
|
|
301
|
+
helm.define_singleton_method(:run) { |cmd| captured_cmd = cmd; "" }
|
|
302
|
+
begin
|
|
303
|
+
repo.add
|
|
304
|
+
ensure
|
|
305
|
+
helm.define_singleton_method(:run, original)
|
|
301
306
|
end
|
|
302
307
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami", cluster: cluster)
|
|
306
|
-
|
|
307
|
-
captured_cmd = nil
|
|
308
|
-
cluster.connection.helm.stub(:run, ->(cmd) { captured_cmd = cmd; "" }) do
|
|
309
|
-
repo.add
|
|
310
|
-
end
|
|
311
|
-
|
|
312
|
-
assert_includes captured_cmd, "repo"
|
|
313
|
-
assert_includes captured_cmd, "add"
|
|
314
|
-
assert_includes captured_cmd, "bitnami"
|
|
315
|
-
end
|
|
308
|
+
captured_cmd.should.include "add"
|
|
309
|
+
end
|
|
316
310
|
|
|
317
|
-
|
|
311
|
+
# ── to_s ──────────────────────────────────────────────────────────────
|
|
318
312
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
end
|
|
313
|
+
it "to_s" do
|
|
314
|
+
repo = Kube::Helm::Repo.new("bitnami", url: "https://charts.bitnami.com/bitnami")
|
|
315
|
+
repo.to_s.should == "bitnami (https://charts.bitnami.com/bitnami)"
|
|
323
316
|
end
|
|
324
317
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kube_cluster
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nathan K
|
|
@@ -10,19 +10,19 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name:
|
|
13
|
+
name: scampi
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
19
|
-
type: :
|
|
18
|
+
version: '0.1'
|
|
19
|
+
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
25
|
+
version: '0.1'
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: rake
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -57,14 +57,14 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 1.3.
|
|
60
|
+
version: 1.3.7
|
|
61
61
|
type: :runtime
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 1.3.
|
|
67
|
+
version: 1.3.7
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: kube_kubectl
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|