@@ -29,10 +29,11 @@ import (
29
29
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
30
30
"k8s.io/utils/ptr"
31
31
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
32
- . "sigs.k8s.io/cluster-api-operator/test/framework"
33
32
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
34
33
"sigs.k8s.io/cluster-api/test/framework"
35
34
"sigs.k8s.io/controller-runtime/pkg/client"
35
+
36
+ . "sigs.k8s.io/cluster-api-operator/test/framework"
36
37
)
37
38
38
39
var _ = Describe ("Create a proper set of manifests when using helm charts" , func () {
@@ -148,14 +149,20 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
148
149
149
150
It ("should deploy all providers with custom namespace and versions" , func () {
150
151
manifests , err := helmChart .Run (map [string ]string {
151
- "configSecret.name" : "test-secret-name" ,
152
- "configSecret.namespace" : "test-secret-namespace" ,
153
- "core" : "capi-custom-ns:cluster-api:v1.7.7" ,
154
- "controlPlane" : "kubeadm-control-plane-custom-ns:kubeadm:v1.7.7" ,
155
- "bootstrap" : "kubeadm-bootstrap-custom-ns:kubeadm:v1.7.7" ,
156
- "infrastructure" : "capd-custom-ns:docker:v1.7.7" ,
157
- "ipam" : "in-cluster-custom-ns:in-cluster:v1.0.0" ,
158
- "addon" : "helm-custom-ns:helm:v0.2.6" ,
152
+ "configSecret.name" : "test-secret-name" ,
153
+ "configSecret.namespace" : "test-secret-namespace" ,
154
+ "core.cluster-api.namespace" : "capi-custom-ns" ,
155
+ "core.cluster-api.version" : "v1.7.7" ,
156
+ "controlPlane.kubeadm.namespace" : "kubeadm-control-plane-custom-ns" ,
157
+ "controlPlane.kubeadm.version" : "v1.7.7" ,
158
+ "bootstrap.kubeadm.namespace" : "kubeadm-bootstrap-custom-ns" ,
159
+ "bootstrap.kubeadm.version" : "v1.7.7" ,
160
+ "infrastructure.docker.namespace" : "capd-custom-ns" ,
161
+ "infrastructure.docker.version" : "v1.7.7" ,
162
+ "ipam.in-cluster.namespace" : "in-cluster-custom-ns" ,
163
+ "ipam.in-cluster.version" : "v1.0.0" ,
164
+ "addon.helm.namespace" : "helm-custom-ns" ,
165
+ "addon.helm.version" : "v0.2.6" ,
159
166
})
160
167
Expect (err ).ToNot (HaveOccurred ())
161
168
Expect (manifests ).ToNot (BeEmpty ())
@@ -166,14 +173,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
166
173
167
174
It ("should deploy all providers with custom versions" , func () {
168
175
manifests , err := helmChart .Run (map [string ]string {
169
- "configSecret.name" : "test-secret-name" ,
170
- "configSecret.namespace" : "test-secret-namespace" ,
171
- "core" : "cluster-api: v1.7.7" ,
172
- "controlPlane" : "kubeadm: v1.7.7" ,
173
- "bootstrap" : "kubeadm: v1.7.7" ,
174
- "infrastructure" : "docker: v1.7.7" ,
175
- "ipam" : "in-cluster: v1.0.0" ,
176
- "addon" : "helm: v0.2.6" ,
176
+ "configSecret.name" : "test-secret-name" ,
177
+ "configSecret.namespace" : "test-secret-namespace" ,
178
+ "core.cluster-api.version " : " v1.7.7" ,
179
+ "controlPlane.kubeadm.version " : " v1.7.7" ,
180
+ "bootstrap.kubeadm.version " : " v1.7.7" ,
181
+ "infrastructure.docker.version " : " v1.7.7" ,
182
+ "ipam.in-cluster.version " : " v1.0.0" ,
183
+ "addon.helm.version " : " v0.2.6" ,
177
184
})
178
185
Expect (err ).ToNot (HaveOccurred ())
179
186
Expect (manifests ).ToNot (BeEmpty ())
@@ -184,14 +191,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
184
191
185
192
It ("should deploy all providers with latest version" , func () {
186
193
manifests , err := helmChart .Run (map [string ]string {
187
- "configSecret.name" : "test-secret-name" ,
188
- "configSecret.namespace" : "test-secret-namespace" ,
189
- "core" : "cluster-api " ,
190
- "controlPlane" : "kubeadm " ,
191
- "bootstrap" : "kubeadm " ,
192
- "infrastructure" : "docker " ,
193
- "ipam" : "in-cluster " ,
194
- "addon" : "helm " ,
194
+ "configSecret.name" : "test-secret-name" ,
195
+ "configSecret.namespace" : "test-secret-namespace" ,
196
+ "core.cluster-api.enabled " : "true " ,
197
+ "controlPlane.kubeadm.enabled " : "true " ,
198
+ "bootstrap.kubeadm.enabled " : "true " ,
199
+ "infrastructure.docker.enabled " : "true " ,
200
+ "ipam.in-cluster.enabled " : "true " ,
201
+ "addon.helm.enabled " : "true " ,
195
202
})
196
203
Expect (err ).ToNot (HaveOccurred ())
197
204
Expect (manifests ).ToNot (BeEmpty ())
@@ -202,9 +209,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
202
209
203
210
It ("should deploy core, bootstrap, control plane when only infra is specified" , func () {
204
211
manifests , err := helmChart .Run (map [string ]string {
205
- "configSecret.name" : "test-secret-name" ,
206
- "configSecret.namespace" : "test-secret-namespace" ,
207
- "infrastructure" : "docker " ,
212
+ "configSecret.name" : "test-secret-name" ,
213
+ "configSecret.namespace" : "test-secret-namespace" ,
214
+ "infrastructure.docker.enabled " : "true " ,
208
215
})
209
216
Expect (err ).ToNot (HaveOccurred ())
210
217
Expect (manifests ).ToNot (BeEmpty ())
@@ -215,9 +222,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
215
222
216
223
It ("should deploy core when only bootstrap is specified" , func () {
217
224
manifests , err := helmChart .Run (map [string ]string {
218
- "configSecret.name" : "test-secret-name" ,
219
- "configSecret.namespace" : "test-secret-namespace" ,
220
- "bootstrap" : "kubeadm " ,
225
+ "configSecret.name" : "test-secret-name" ,
226
+ "configSecret.namespace" : "test-secret-namespace" ,
227
+ "bootstrap.kubeadm.enabled " : "true " ,
221
228
})
222
229
Expect (err ).ToNot (HaveOccurred ())
223
230
Expect (manifests ).ToNot (BeEmpty ())
@@ -228,9 +235,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
228
235
229
236
It ("should deploy core when only control plane is specified" , func () {
230
237
manifests , err := helmChart .Run (map [string ]string {
231
- "configSecret.name" : "test-secret-name" ,
232
- "configSecret.namespace" : "test-secret-namespace" ,
233
- "controlPlane" : "kubeadm " ,
238
+ "configSecret.name" : "test-secret-name" ,
239
+ "configSecret.namespace" : "test-secret-namespace" ,
240
+ "controlPlane.kubeadm.enabled " : "true " ,
234
241
})
235
242
Expect (err ).ToNot (HaveOccurred ())
236
243
Expect (manifests ).ToNot (BeEmpty ())
@@ -241,9 +248,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
241
248
242
249
It ("should deploy core when only ipam is specified" , func () {
243
250
manifests , err := helmChart .Run (map [string ]string {
244
- "configSecret.name" : "test-secret-name" ,
245
- "configSecret.namespace" : "test-secret-namespace" ,
246
- "ipam" : "in-cluster " ,
251
+ "configSecret.name" : "test-secret-name" ,
252
+ "configSecret.namespace" : "test-secret-namespace" ,
253
+ "ipam.in-cluster.enabled " : "true " ,
247
254
})
248
255
Expect (err ).ToNot (HaveOccurred ())
249
256
Expect (manifests ).ToNot (BeEmpty ())
@@ -254,10 +261,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
254
261
255
262
It ("should deploy core, bootstrap, control plane when only infra and ipam is specified" , func () {
256
263
manifests , err := helmChart .Run (map [string ]string {
257
- "configSecret.name" : "test-secret-name" ,
258
- "configSecret.namespace" : "test-secret-namespace" ,
259
- "infrastructure" : "docker " ,
260
- "ipam" : "in-cluster " ,
264
+ "configSecret.name" : "test-secret-name" ,
265
+ "configSecret.namespace" : "test-secret-namespace" ,
266
+ "infrastructure.docker.enabled " : "true " ,
267
+ "ipam.in-cluster.enabled " : "true " ,
261
268
})
262
269
Expect (err ).ToNot (HaveOccurred ())
263
270
Expect (manifests ).ToNot (BeEmpty ())
@@ -268,9 +275,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
268
275
269
276
It ("should deploy multiple infra providers with custom namespace and versions" , func () {
270
277
manifests , err := helmChart .Run (map [string ]string {
271
- "configSecret.name" : "test-secret-name" ,
272
- "configSecret.namespace" : "test-secret-namespace" ,
273
- "infrastructure" : "capd-custom-ns:docker:v1.7.7;capz-custom-ns:azure:v1.10.0" ,
278
+ "configSecret.name" : "test-secret-name" ,
279
+ "configSecret.namespace" : "test-secret-namespace" ,
280
+ "infrastructure.docker.namespace" : "capd-custom-ns" ,
281
+ "infrastructure.docker.version" : "v1.7.7" ,
282
+ "infrastructure.azure.namespace" : "capz-custom-ns" ,
283
+ "infrastructure.azure.version" : "v1.10.0" ,
274
284
})
275
285
Expect (err ).ToNot (HaveOccurred ())
276
286
Expect (manifests ).ToNot (BeEmpty ())
@@ -281,9 +291,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
281
291
282
292
It ("should deploy multiple control plane providers with custom namespace and versions" , func () {
283
293
manifests , err := helmChart .Run (map [string ]string {
284
- "configSecret.name" : "test-secret-name" ,
285
- "configSecret.namespace" : "test-secret-namespace" ,
286
- "controlPlane" : "kubeadm-control-plane-custom-ns:kubeadm:v1.7.7;rke2-control-plane-custom-ns:rke2:v0.8.0" ,
294
+ "configSecret.name" : "test-secret-name" ,
295
+ "configSecret.namespace" : "test-secret-namespace" ,
296
+ "controlPlane.kubeadm.namespace" : "kubeadm-control-plane-custom-ns" ,
297
+ "controlPlane.kubeadm.version" : "v1.7.7" ,
298
+ "controlPlane.rke2.namespace" : "rke2-control-plane-custom-ns" ,
299
+ "controlPlane.rke2.version" : "v0.8.0" ,
287
300
})
288
301
Expect (err ).ToNot (HaveOccurred ())
289
302
Expect (manifests ).ToNot (BeEmpty ())
@@ -294,9 +307,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
294
307
295
308
It ("should deploy multiple bootstrap providers with custom namespace and versions" , func () {
296
309
manifests , err := helmChart .Run (map [string ]string {
297
- "configSecret.name" : "test-secret-name" ,
298
- "configSecret.namespace" : "test-secret-namespace" ,
299
- "bootstrap" : "kubeadm-bootstrap-custom-ns:kubeadm:v1.7.7;rke2-bootstrap-custom-ns:rke2:v0.8.0" ,
310
+ "configSecret.name" : "test-secret-name" ,
311
+ "configSecret.namespace" : "test-secret-namespace" ,
312
+ "bootstrap.kubeadm.namespace" : "kubeadm-bootstrap-custom-ns" ,
313
+ "bootstrap.kubeadm.version" : "v1.7.7" ,
314
+ "bootstrap.rke2.namespace" : "rke2-bootstrap-custom-ns" ,
315
+ "bootstrap.rke2.version" : "v0.8.0" ,
300
316
})
301
317
Expect (err ).ToNot (HaveOccurred ())
302
318
Expect (manifests ).ToNot (BeEmpty ())
@@ -309,7 +325,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
309
325
manifests , err := helmChart .Run (map [string ]string {
310
326
"configSecret.name" : "test-secret-name" ,
311
327
"configSecret.namespace" : "test-secret-namespace" ,
312
- "addon" : "helm " ,
328
+ "addon.helm.enabled " : "true " ,
313
329
})
314
330
Expect (err ).ToNot (HaveOccurred ())
315
331
Expect (manifests ).ToNot (BeEmpty ())
@@ -320,10 +336,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
320
336
321
337
It ("should deploy core, bootstrap, control plane when only infra and addon is specified" , func () {
322
338
manifests , err := helmChart .Run (map [string ]string {
323
- "configSecret.name" : "test-secret-name" ,
324
- "configSecret.namespace" : "test-secret-namespace" ,
325
- "infrastructure" : "docker " ,
326
- "addon" : "helm " ,
339
+ "configSecret.name" : "test-secret-name" ,
340
+ "configSecret.namespace" : "test-secret-namespace" ,
341
+ "infrastructure.docker.enabled " : "true " ,
342
+ "addon.helm.enabled " : "true " ,
327
343
})
328
344
Expect (err ).ToNot (HaveOccurred ())
329
345
Expect (manifests ).ToNot (BeEmpty ())
@@ -333,15 +349,15 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
333
349
})
334
350
It ("should deploy core and infra with feature gates enabled" , func () {
335
351
manifests , err := helmChart .Run (map [string ]string {
336
- "configSecret.name" : "aws-variables" ,
337
- "configSecret.namespace" : "default" ,
338
- "infrastructure" : "aws: v2.4.0" ,
339
- "ipam" : "in-cluster: " ,
340
- "addon" : "helm: " ,
341
- "image.manager.tag" : "v0.9.1" ,
342
- "cert-manager.enabled" : "false" ,
343
- "cert-manager.installCRDs" : "false" ,
344
- "core" : "cluster-api: v1.6.2" ,
352
+ "configSecret.name" : "aws-variables" ,
353
+ "configSecret.namespace" : "default" ,
354
+ "infrastructure.aws.version " : " v2.4.0" ,
355
+ "ipam.in-cluster.enabled " : "true " ,
356
+ "addon.helm.enabled " : "true " ,
357
+ "image.manager.tag" : "v0.9.1" ,
358
+ "cert-manager.enabled" : "false" ,
359
+ "cert-manager.installCRDs" : "false" ,
360
+ "core.cluster-api.version " : " v1.6.2" ,
345
361
"manager.featureGates.core.ClusterTopology" : "true" ,
346
362
"manager.featureGates.core.MachinePool" : "true" ,
347
363
"manager.featureGates.aws.ClusterTopology" : "true" ,
@@ -359,10 +375,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
359
375
manifests , err := helmChart .Run (map [string ]string {
360
376
"configSecret.name" : "test-secret-name" ,
361
377
"configSecret.namespace" : "test-secret-namespace" ,
362
- "core" : "cluster-api " ,
363
- "infrastructure" : "azure " ,
364
- "ipam" : "in-cluster " ,
365
- "addon" : "helm " ,
378
+ "core.cluster-api.enabled " : "true " ,
379
+ "infrastructure.azure.enabled " : "true " ,
380
+ "ipam.in-cluster.enabled " : "true " ,
381
+ "addon.helm.enabled " : "true " ,
366
382
"manager.cert-manager.enabled" : "false" ,
367
383
"manager.cert-manager.installCRDs" : "false" ,
368
384
})
@@ -374,12 +390,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
374
390
})
375
391
It ("should deploy all providers when manager is defined but another infrastructure spec field is defined" , func () {
376
392
manifests , err := helmChart .Run (map [string ]string {
377
- "core" : "cluster-api " ,
378
- "controlPlane" : "kubeadm " ,
379
- "bootstrap" : "kubeadm " ,
380
- "infrastructure" : "docker " ,
381
- "ipam" : "in-cluster " ,
382
- "addon" : "helm " ,
393
+ "core.cluster-api.enabled " : "true " ,
394
+ "controlPlane.kubeadm.enabled " : "true " ,
395
+ "bootstrap.kubeadm.enabled " : "true " ,
396
+ "infrastructure.docker.enabled " : "true " ,
397
+ "ipam.in-cluster.enabled " : "true " ,
398
+ "addon.helm.enabled " : "true " ,
383
399
"manager.featureGates.core.ClusterTopology" : "true" ,
384
400
"manager.featureGates.core.MachinePool" : "true" ,
385
401
})
@@ -391,12 +407,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
391
407
})
392
408
It ("should deploy kubeadm control plane with manager specified" , func () {
393
409
manifests , err := helmChart .Run (map [string ]string {
394
- "core" : "cluster-api " ,
395
- "controlPlane" : "kubeadm " ,
396
- "bootstrap" : "kubeadm " ,
397
- "infrastructure" : "docker " ,
398
- "ipam" : "in-cluster " ,
399
- "addon" : "helm " ,
410
+ "core.cluster-api.enabled " : "true " ,
411
+ "controlPlane.kubeadm.enabled " : "true " ,
412
+ "bootstrap.kubeadm.enabled " : "true " ,
413
+ "infrastructure.docker.enabled " : "true " ,
414
+ "ipam.in-cluster.enabled " : "true " ,
415
+ "addon.helm.enabled " : "true " ,
400
416
"manager.featureGates.kubeadm.ClusterTopology" : "true" ,
401
417
"manager.featureGates.kubeadm.MachinePool" : "true" ,
402
418
})
0 commit comments