Skip to content

Commit ec03062

Browse files
committed
Update e2e tests
1 parent b358f27 commit ec03062

10 files changed

+160
-129
lines changed

test/e2e/helm_test.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
5353

5454
It("should deploy all providers with custom namespace and versions", func() {
5555
manifests, err := helmChart.Run(map[string]string{
56-
"secretName": "test-secret-name",
57-
"secretNamespace": "test-secret-namespace",
58-
"core": "capi-custom-ns:cluster-api:v1.4.2",
59-
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2",
60-
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2",
61-
"infrastructure": "capd-custom-ns:docker:v1.4.2",
56+
"configSecret.Name": "test-secret-name",
57+
"configSecret.Namespace": "test-secret-namespace",
58+
"core": "capi-custom-ns:cluster-api:v1.4.2",
59+
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2",
60+
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2",
61+
"infrastructure": "capd-custom-ns:docker:v1.4.2",
6262
})
6363
Expect(err).ToNot(HaveOccurred())
6464
Expect(manifests).ToNot(BeEmpty())
@@ -69,12 +69,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
6969

7070
It("should deploy all providers with custom versions", func() {
7171
manifests, err := helmChart.Run(map[string]string{
72-
"secretName": "test-secret-name",
73-
"secretNamespace": "test-secret-namespace",
74-
"core": "cluster-api:v1.4.2",
75-
"controlPlane": "kubeadm:v1.4.2",
76-
"bootstrap": "kubeadm:v1.4.2",
77-
"infrastructure": "docker:v1.4.2",
72+
"configSecret.Name": "test-secret-name",
73+
"configSecret.Namespace": "test-secret-namespace",
74+
"core": "cluster-api:v1.4.2",
75+
"controlPlane": "kubeadm:v1.4.2",
76+
"bootstrap": "kubeadm:v1.4.2",
77+
"infrastructure": "docker:v1.4.2",
7878
})
7979
Expect(err).ToNot(HaveOccurred())
8080
Expect(manifests).ToNot(BeEmpty())
@@ -85,12 +85,12 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
8585

8686
It("should deploy all providers with latest version", func() {
8787
manifests, err := helmChart.Run(map[string]string{
88-
"secretName": "test-secret-name",
89-
"secretNamespace": "test-secret-namespace",
90-
"core": "cluster-api",
91-
"controlPlane": "kubeadm",
92-
"bootstrap": "kubeadm",
93-
"infrastructure": "docker",
88+
"configSecret.Name": "test-secret-name",
89+
"configSecret.Namespace": "test-secret-namespace",
90+
"core": "cluster-api",
91+
"controlPlane": "kubeadm",
92+
"bootstrap": "kubeadm",
93+
"infrastructure": "docker",
9494
})
9595
Expect(err).ToNot(HaveOccurred())
9696
Expect(manifests).ToNot(BeEmpty())
@@ -101,9 +101,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
101101

102102
It("should deploy core, bootstrap, control plane when only infra is specified", func() {
103103
manifests, err := helmChart.Run(map[string]string{
104-
"secretName": "test-secret-name",
105-
"secretNamespace": "test-secret-namespace",
106-
"infrastructure": "docker",
104+
"configSecret.Name": "test-secret-name",
105+
"configSecret.Namespace": "test-secret-namespace",
106+
"infrastructure": "docker",
107107
})
108108
Expect(err).ToNot(HaveOccurred())
109109
Expect(manifests).ToNot(BeEmpty())
@@ -114,9 +114,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
114114

115115
It("should deploy core when only bootstrap is specified", func() {
116116
manifests, err := helmChart.Run(map[string]string{
117-
"secretName": "test-secret-name",
118-
"secretNamespace": "test-secret-namespace",
119-
"bootstrap": "kubeadm",
117+
"configSecret.Name": "test-secret-name",
118+
"configSecret.Namespace": "test-secret-namespace",
119+
"bootstrap": "kubeadm",
120120
})
121121
Expect(err).ToNot(HaveOccurred())
122122
Expect(manifests).ToNot(BeEmpty())
@@ -127,9 +127,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
127127

128128
It("should deploy core when only control plane is specified", func() {
129129
manifests, err := helmChart.Run(map[string]string{
130-
"secretName": "test-secret-name",
131-
"secretNamespace": "test-secret-namespace",
132-
"controlPlane": "kubeadm",
130+
"configSecret.Name": "test-secret-name",
131+
"configSecret.Namespace": "test-secret-namespace",
132+
"controlPlane": "kubeadm",
133133
})
134134
Expect(err).ToNot(HaveOccurred())
135135
Expect(manifests).ToNot(BeEmpty())
@@ -140,9 +140,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
140140

141141
It("should deploy multiple infra providers with custom namespace and versions", func() {
142142
manifests, err := helmChart.Run(map[string]string{
143-
"secretName": "test-secret-name",
144-
"secretNamespace": "test-secret-namespace",
145-
"infrastructure": "capd-custom-ns:docker:v1.4.2;capz-custom-ns:azure:v1.10.0",
143+
"configSecret.Name": "test-secret-name",
144+
"configSecret.Namespace": "test-secret-namespace",
145+
"infrastructure": "capd-custom-ns:docker:v1.4.2;capz-custom-ns:azure:v1.10.0",
146146
})
147147
Expect(err).ToNot(HaveOccurred())
148148
Expect(manifests).ToNot(BeEmpty())
@@ -153,9 +153,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
153153

154154
It("should deploy multiple control plane providers with custom namespace and versions", func() {
155155
manifests, err := helmChart.Run(map[string]string{
156-
"secretName": "test-secret-name",
157-
"secretNamespace": "test-secret-namespace",
158-
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2;rke2-control-plane-custom-ns:rke2:v0.3.0",
156+
"configSecret.Name": "test-secret-name",
157+
"configSecret.Namespace": "test-secret-namespace",
158+
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2;rke2-control-plane-custom-ns:rke2:v0.3.0",
159159
})
160160
Expect(err).ToNot(HaveOccurred())
161161
Expect(manifests).ToNot(BeEmpty())
@@ -166,9 +166,9 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
166166

167167
It("should deploy multiple bootstrap providers with custom namespace and versions", func() {
168168
manifests, err := helmChart.Run(map[string]string{
169-
"secretName": "test-secret-name",
170-
"secretNamespace": "test-secret-namespace",
171-
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2;rke2-bootstrap-custom-ns:rke2:v0.3.0",
169+
"configSecret.Name": "test-secret-name",
170+
"configSecret.Namespace": "test-secret-namespace",
171+
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2;rke2-bootstrap-custom-ns:rke2:v0.3.0",
172172
})
173173
Expect(err).ToNot(HaveOccurred())
174174
Expect(manifests).ToNot(BeEmpty())

test/e2e/resources/all-providers-custom-ns-versions.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ metadata:
3636
name: capd-custom-ns
3737
---
3838
# Source: cluster-api-operator/templates/bootstrap.yaml
39-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
39+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
4040
kind: BootstrapProvider
4141
metadata:
4242
name: kubeadm
@@ -46,11 +46,12 @@ metadata:
4646
"helm.sh/hook-weight": "2"
4747
spec:
4848
version: v1.4.2
49-
secretName: test-secret-name
50-
secretNamespace: test-secret-namespace
49+
configSecret:
50+
name: test-secret-name
51+
namespace: test-secret-namespace
5152
---
5253
# Source: cluster-api-operator/templates/control-plane.yaml
53-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
54+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
5455
kind: ControlPlaneProvider
5556
metadata:
5657
name: kubeadm
@@ -60,11 +61,12 @@ metadata:
6061
"helm.sh/hook-weight": "2"
6162
spec:
6263
version: v1.4.2
63-
secretName: test-secret-name
64-
secretNamespace: test-secret-namespace
64+
configSecret:
65+
name: test-secret-name
66+
namespace: test-secret-namespace
6567
---
6668
# Source: cluster-api-operator/templates/core.yaml
67-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
69+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
6870
kind: CoreProvider
6971
metadata:
7072
name: cluster-api
@@ -74,11 +76,12 @@ metadata:
7476
"helm.sh/hook-weight": "2"
7577
spec:
7678
version: v1.4.2
77-
secretName: test-secret-name
78-
secretNamespace: test-secret-namespace
79+
configSecret:
80+
name: test-secret-name
81+
namespace: test-secret-namespace
7982
---
8083
# Source: cluster-api-operator/templates/infra.yaml
81-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
84+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
8285
kind: InfrastructureProvider
8386
metadata:
8487
name: docker
@@ -88,5 +91,6 @@ metadata:
8891
"helm.sh/hook-weight": "2"
8992
spec:
9093
version: v1.4.2
91-
secretName: test-secret-name
92-
secretNamespace: test-secret-namespace
94+
configSecret:
95+
name: test-secret-name
96+
namespace: test-secret-namespace

test/e2e/resources/all-providers-custom-versions.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ metadata:
3636
name: docker-infrastructure-system
3737
---
3838
# Source: cluster-api-operator/templates/bootstrap.yaml
39-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
39+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
4040
kind: BootstrapProvider
4141
metadata:
4242
name: kubeadm
@@ -46,11 +46,12 @@ metadata:
4646
"helm.sh/hook-weight": "2"
4747
spec:
4848
version: v1.4.2
49-
secretName: test-secret-name
50-
secretNamespace: test-secret-namespace
49+
configSecret:
50+
name: test-secret-name
51+
namespace: test-secret-namespace
5152
---
5253
# Source: cluster-api-operator/templates/control-plane.yaml
53-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
54+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
5455
kind: ControlPlaneProvider
5556
metadata:
5657
name: kubeadm
@@ -60,11 +61,12 @@ metadata:
6061
"helm.sh/hook-weight": "2"
6162
spec:
6263
version: v1.4.2
63-
secretName: test-secret-name
64-
secretNamespace: test-secret-namespace
64+
configSecret:
65+
name: test-secret-name
66+
namespace: test-secret-namespace
6567
---
6668
# Source: cluster-api-operator/templates/core.yaml
67-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
69+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
6870
kind: CoreProvider
6971
metadata:
7072
name: cluster-api
@@ -74,11 +76,12 @@ metadata:
7476
"helm.sh/hook-weight": "2"
7577
spec:
7678
version: v1.4.2
77-
secretName: test-secret-name
78-
secretNamespace: test-secret-namespace
79+
configSecret:
80+
name: test-secret-name
81+
namespace: test-secret-namespace
7982
---
8083
# Source: cluster-api-operator/templates/infra.yaml
81-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
84+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
8285
kind: InfrastructureProvider
8386
metadata:
8487
name: docker
@@ -88,5 +91,6 @@ metadata:
8891
"helm.sh/hook-weight": "2"
8992
spec:
9093
version: v1.4.2
91-
secretName: test-secret-name
92-
secretNamespace: test-secret-namespace
94+
configSecret:
95+
name: test-secret-name
96+
namespace: test-secret-namespace

test/e2e/resources/all-providers-latest-versions.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ metadata:
3636
name: docker-infrastructure-system
3737
---
3838
# Source: cluster-api-operator/templates/bootstrap.yaml
39-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
39+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
4040
kind: BootstrapProvider
4141
metadata:
4242
name: kubeadm
@@ -45,11 +45,12 @@ metadata:
4545
"helm.sh/hook": "post-install"
4646
"helm.sh/hook-weight": "2"
4747
spec:
48-
secretName: test-secret-name
49-
secretNamespace: test-secret-namespace
48+
configSecret:
49+
name: test-secret-name
50+
namespace: test-secret-namespace
5051
---
5152
# Source: cluster-api-operator/templates/control-plane.yaml
52-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
53+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
5354
kind: ControlPlaneProvider
5455
metadata:
5556
name: kubeadm
@@ -58,11 +59,12 @@ metadata:
5859
"helm.sh/hook": "post-install"
5960
"helm.sh/hook-weight": "2"
6061
spec:
61-
secretName: test-secret-name
62-
secretNamespace: test-secret-namespace
62+
configSecret:
63+
name: test-secret-name
64+
namespace: test-secret-namespace
6365
---
6466
# Source: cluster-api-operator/templates/core.yaml
65-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
67+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
6668
kind: CoreProvider
6769
metadata:
6870
name: cluster-api
@@ -71,11 +73,12 @@ metadata:
7173
"helm.sh/hook": "post-install"
7274
"helm.sh/hook-weight": "2"
7375
spec:
74-
secretName: test-secret-name
75-
secretNamespace: test-secret-namespace
76+
configSecret:
77+
name: test-secret-name
78+
namespace: test-secret-namespace
7679
---
7780
# Source: cluster-api-operator/templates/infra.yaml
78-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
81+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
7982
kind: InfrastructureProvider
8083
metadata:
8184
name: docker
@@ -84,5 +87,6 @@ metadata:
8487
"helm.sh/hook": "post-install"
8588
"helm.sh/hook-weight": "2"
8689
spec:
87-
secretName: test-secret-name
88-
secretNamespace: test-secret-namespace
90+
configSecret:
91+
name: test-secret-name
92+
namespace: test-secret-namespace

test/e2e/resources/multiple-bootstrap-custom-ns-versions.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ metadata:
2727
name: rke2-bootstrap-custom-ns
2828
---
2929
# Source: cluster-api-operator/templates/bootstrap.yaml
30-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
30+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
3131
kind: BootstrapProvider
3232
metadata:
3333
name: kubeadm
@@ -37,11 +37,12 @@ metadata:
3737
"helm.sh/hook-weight": "2"
3838
spec:
3939
version: v1.4.2
40-
secretName: test-secret-name
41-
secretNamespace: test-secret-namespace
40+
configSecret:
41+
name: test-secret-name
42+
namespace: test-secret-namespace
4243
---
4344
# Source: cluster-api-operator/templates/bootstrap.yaml
44-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
45+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
4546
kind: BootstrapProvider
4647
metadata:
4748
name: rke2
@@ -51,11 +52,12 @@ metadata:
5152
"helm.sh/hook-weight": "2"
5253
spec:
5354
version: v0.3.0
54-
secretName: test-secret-name
55-
secretNamespace: test-secret-namespace
55+
configSecret:
56+
name: test-secret-name
57+
namespace: test-secret-namespace
5658
---
5759
# Source: cluster-api-operator/templates/bootstrap-conditions.yaml
58-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
60+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
5961
kind: CoreProvider
6062
metadata:
6163
name: cluster-api
@@ -64,5 +66,6 @@ metadata:
6466
"helm.sh/hook": "post-install"
6567
"helm.sh/hook-weight": "2"
6668
spec:
67-
secretName: test-secret-name
68-
secretNamespace: test-secret-namespace
69+
configSecret:
70+
name: test-secret-name
71+
namespace: test-secret-namespace

0 commit comments

Comments
 (0)