Skip to content

Commit f23f00c

Browse files
committed
fix: align test value declaration with chart changes
1 parent 6517f01 commit f23f00c

File tree

1 file changed

+96
-80
lines changed

1 file changed

+96
-80
lines changed

test/e2e/helm_test.go

Lines changed: 96 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ import (
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
"k8s.io/utils/ptr"
3131
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
32-
. "sigs.k8s.io/cluster-api-operator/test/framework"
3332
clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
3433
"sigs.k8s.io/cluster-api/test/framework"
3534
"sigs.k8s.io/controller-runtime/pkg/client"
35+
36+
. "sigs.k8s.io/cluster-api-operator/test/framework"
3637
)
3738

3839
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
148149

149150
It("should deploy all providers with custom namespace and versions", func() {
150151
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",
159166
})
160167
Expect(err).ToNot(HaveOccurred())
161168
Expect(manifests).ToNot(BeEmpty())
@@ -166,14 +173,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
166173

167174
It("should deploy all providers with custom versions", func() {
168175
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",
177184
})
178185
Expect(err).ToNot(HaveOccurred())
179186
Expect(manifests).ToNot(BeEmpty())
@@ -184,14 +191,14 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
184191

185192
It("should deploy all providers with latest version", func() {
186193
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",
195202
})
196203
Expect(err).ToNot(HaveOccurred())
197204
Expect(manifests).ToNot(BeEmpty())
@@ -202,9 +209,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
202209

203210
It("should deploy core, bootstrap, control plane when only infra is specified", func() {
204211
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",
208215
})
209216
Expect(err).ToNot(HaveOccurred())
210217
Expect(manifests).ToNot(BeEmpty())
@@ -215,9 +222,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
215222

216223
It("should deploy core when only bootstrap is specified", func() {
217224
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",
221228
})
222229
Expect(err).ToNot(HaveOccurred())
223230
Expect(manifests).ToNot(BeEmpty())
@@ -228,9 +235,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
228235

229236
It("should deploy core when only control plane is specified", func() {
230237
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",
234241
})
235242
Expect(err).ToNot(HaveOccurred())
236243
Expect(manifests).ToNot(BeEmpty())
@@ -241,9 +248,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
241248

242249
It("should deploy core when only ipam is specified", func() {
243250
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",
247254
})
248255
Expect(err).ToNot(HaveOccurred())
249256
Expect(manifests).ToNot(BeEmpty())
@@ -254,10 +261,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
254261

255262
It("should deploy core, bootstrap, control plane when only infra and ipam is specified", func() {
256263
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",
261268
})
262269
Expect(err).ToNot(HaveOccurred())
263270
Expect(manifests).ToNot(BeEmpty())
@@ -268,9 +275,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
268275

269276
It("should deploy multiple infra providers with custom namespace and versions", func() {
270277
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",
274284
})
275285
Expect(err).ToNot(HaveOccurred())
276286
Expect(manifests).ToNot(BeEmpty())
@@ -281,9 +291,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
281291

282292
It("should deploy multiple control plane providers with custom namespace and versions", func() {
283293
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",
287300
})
288301
Expect(err).ToNot(HaveOccurred())
289302
Expect(manifests).ToNot(BeEmpty())
@@ -294,9 +307,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
294307

295308
It("should deploy multiple bootstrap providers with custom namespace and versions", func() {
296309
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",
300316
})
301317
Expect(err).ToNot(HaveOccurred())
302318
Expect(manifests).ToNot(BeEmpty())
@@ -309,7 +325,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
309325
manifests, err := helmChart.Run(map[string]string{
310326
"configSecret.name": "test-secret-name",
311327
"configSecret.namespace": "test-secret-namespace",
312-
"addon": "helm",
328+
"addon.helm.enabled": "true",
313329
})
314330
Expect(err).ToNot(HaveOccurred())
315331
Expect(manifests).ToNot(BeEmpty())
@@ -320,10 +336,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
320336

321337
It("should deploy core, bootstrap, control plane when only infra and addon is specified", func() {
322338
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",
327343
})
328344
Expect(err).ToNot(HaveOccurred())
329345
Expect(manifests).ToNot(BeEmpty())
@@ -333,15 +349,15 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
333349
})
334350
It("should deploy core and infra with feature gates enabled", func() {
335351
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",
345361
"manager.featureGates.core.ClusterTopology": "true",
346362
"manager.featureGates.core.MachinePool": "true",
347363
"manager.featureGates.aws.ClusterTopology": "true",
@@ -359,10 +375,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
359375
manifests, err := helmChart.Run(map[string]string{
360376
"configSecret.name": "test-secret-name",
361377
"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",
366382
"manager.cert-manager.enabled": "false",
367383
"manager.cert-manager.installCRDs": "false",
368384
})
@@ -374,12 +390,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
374390
})
375391
It("should deploy all providers when manager is defined but another infrastructure spec field is defined", func() {
376392
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",
383399
"manager.featureGates.core.ClusterTopology": "true",
384400
"manager.featureGates.core.MachinePool": "true",
385401
})
@@ -391,12 +407,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
391407
})
392408
It("should deploy kubeadm control plane with manager specified", func() {
393409
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",
400416
"manager.featureGates.kubeadm.ClusterTopology": "true",
401417
"manager.featureGates.kubeadm.MachinePool": "true",
402418
})

0 commit comments

Comments
 (0)