Skip to content

Commit ea3ba4c

Browse files
authored
Merge pull request #1 from zioproto/pr448-zioproto
Added test
2 parents fa051d4 + 35e6d85 commit ea3ba4c

File tree

2 files changed

+146
-0
lines changed

2 files changed

+146
-0
lines changed

test/e2e/helm_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,27 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
206206
Expect(err).ToNot(HaveOccurred())
207207
Expect(manifests).To(Equal(string(expectedManifests)))
208208
})
209+
It("should deploy core and infra with feature gates enabled", func() {
210+
manifests, err := helmChart.Run(map[string]string{
211+
"configSecret.name": "aws-variables",
212+
"configSecret.namespace": "default",
213+
"infrastructure": "aws:v2.4.0",
214+
"addon": "helm:",
215+
"image.manager.tag": "v0.9.1",
216+
"cert-manager.enabled": "false",
217+
"cert-manager.installCRDs": "false",
218+
"core": "cluster-api:v1.6.2",
219+
"manager.featureGates.core.ClusterTopology": "true",
220+
"manager.featureGates.core.MachinePool": "true",
221+
"manager.featureGates.aws.ClusterTopology": "true",
222+
"manager.featureGates.aws.MachinePool": "true",
223+
"manager.featureGates.aws.EKSEnableIAM": "true",
224+
"manager.featureGates.aws.EKSAllowAddRoles": "true",
225+
})
226+
Expect(err).ToNot(HaveOccurred())
227+
Expect(manifests).ToNot(BeEmpty())
228+
expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "feature-gates.yaml"))
229+
Expect(err).ToNot(HaveOccurred())
230+
Expect(manifests).To(Equal(string(expectedManifests)))
231+
})
209232
})

test/e2e/resources/feature-gates.yaml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
# Source: cluster-api-operator/templates/addon.yaml
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
annotations:
7+
"helm.sh/hook": "post-install"
8+
"helm.sh/hook-weight": "1"
9+
name: helm-addon-system
10+
---
11+
# Source: cluster-api-operator/templates/core.yaml
12+
apiVersion: v1
13+
kind: Namespace
14+
metadata:
15+
annotations:
16+
"helm.sh/hook": "post-install"
17+
"helm.sh/hook-weight": "1"
18+
name: capi-system
19+
---
20+
# Source: cluster-api-operator/templates/infra-conditions.yaml
21+
apiVersion: v1
22+
kind: Namespace
23+
metadata:
24+
annotations:
25+
"helm.sh/hook": "post-install"
26+
"helm.sh/hook-weight": "1"
27+
name: capi-kubeadm-bootstrap-system
28+
---
29+
# Source: cluster-api-operator/templates/infra-conditions.yaml
30+
apiVersion: v1
31+
kind: Namespace
32+
metadata:
33+
annotations:
34+
"helm.sh/hook": "post-install"
35+
"helm.sh/hook-weight": "1"
36+
name: capi-kubeadm-control-plane-system
37+
---
38+
# Source: cluster-api-operator/templates/infra.yaml
39+
apiVersion: v1
40+
kind: Namespace
41+
metadata:
42+
annotations:
43+
"helm.sh/hook": "post-install"
44+
"helm.sh/hook-weight": "1"
45+
name: aws-infrastructure-system
46+
---
47+
# Source: cluster-api-operator/templates/addon.yaml
48+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
49+
kind: AddonProvider
50+
metadata:
51+
name: helm
52+
namespace: helm-addon-system
53+
annotations:
54+
"helm.sh/hook": "post-install"
55+
"helm.sh/hook-weight": "2"
56+
---
57+
# Source: cluster-api-operator/templates/infra-conditions.yaml
58+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
59+
kind: BootstrapProvider
60+
metadata:
61+
name: kubeadm
62+
namespace: capi-kubeadm-bootstrap-system
63+
annotations:
64+
"helm.sh/hook": "post-install"
65+
"helm.sh/hook-weight": "2"
66+
spec:
67+
configSecret:
68+
name: aws-variables
69+
namespace: default
70+
---
71+
# Source: cluster-api-operator/templates/infra-conditions.yaml
72+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
73+
kind: ControlPlaneProvider
74+
metadata:
75+
name: kubeadm
76+
namespace: capi-kubeadm-control-plane-system
77+
annotations:
78+
"helm.sh/hook": "post-install"
79+
"helm.sh/hook-weight": "2"
80+
spec:
81+
configSecret:
82+
name: aws-variables
83+
namespace: default
84+
---
85+
# Source: cluster-api-operator/templates/core.yaml
86+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
87+
kind: CoreProvider
88+
metadata:
89+
name: cluster-api
90+
namespace: capi-system
91+
annotations:
92+
"helm.sh/hook": "post-install"
93+
"helm.sh/hook-weight": "2"
94+
spec:
95+
version: v1.6.2
96+
manager:
97+
featureGates:
98+
ClusterTopology: true
99+
MachinePool: true
100+
configSecret:
101+
name: aws-variables
102+
namespace: default
103+
---
104+
# Source: cluster-api-operator/templates/infra.yaml
105+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
106+
kind: InfrastructureProvider
107+
metadata:
108+
name: aws
109+
namespace: aws-infrastructure-system
110+
annotations:
111+
"helm.sh/hook": "post-install"
112+
"helm.sh/hook-weight": "2"
113+
spec:
114+
version: v2.4.0
115+
manager:
116+
featureGates:
117+
ClusterTopology: true
118+
EKSAllowAddRoles: true
119+
EKSEnableIAM: true
120+
MachinePool: true
121+
configSecret:
122+
name: aws-variables
123+
namespace: default

0 commit comments

Comments
 (0)