Skip to content

Commit 80c8b64

Browse files
committed
Added test
1 parent 52c29db commit 80c8b64

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

test/e2e/helm_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,20 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
261261
Expect(err).ToNot(HaveOccurred())
262262
Expect(manifests).To(MatchYAML(string(expectedManifests)))
263263
})
264+
It("should deploy kubeadm control plane with manager specified", func() {
265+
manifests, err := helmChart.Run(map[string]string{
266+
"core": "cluster-api",
267+
"controlPlane": "kubeadm",
268+
"bootstrap": "kubeadm",
269+
"infrastructure": "docker",
270+
"addon": "helm",
271+
"manager.featureGates.kubeadm.ClusterTopology": "true",
272+
"manager.featureGates.kubeadm.MachinePool": "true",
273+
})
274+
Expect(err).ToNot(HaveOccurred())
275+
Expect(manifests).ToNot(BeEmpty())
276+
expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml"))
277+
Expect(err).ToNot(HaveOccurred())
278+
Expect(manifests).To(MatchYAML(string(expectedManifests)))
279+
})
264280
})
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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,post-upgrade"
8+
"helm.sh/hook-weight": "1"
9+
"argocd.argoproj.io/sync-wave": "1"
10+
name: helm-addon-system
11+
---
12+
# Source: cluster-api-operator/templates/bootstrap.yaml
13+
apiVersion: v1
14+
kind: Namespace
15+
metadata:
16+
annotations:
17+
"helm.sh/hook": "post-install,post-upgrade"
18+
"helm.sh/hook-weight": "1"
19+
name: kubeadm-bootstrap-system
20+
---
21+
# Source: cluster-api-operator/templates/control-plane.yaml
22+
apiVersion: v1
23+
kind: Namespace
24+
metadata:
25+
annotations:
26+
"helm.sh/hook": "post-install,post-upgrade"
27+
"helm.sh/hook-weight": "1"
28+
name: kubeadm-control-plane-system
29+
---
30+
# Source: cluster-api-operator/templates/core.yaml
31+
apiVersion: v1
32+
kind: Namespace
33+
metadata:
34+
annotations:
35+
"helm.sh/hook": "post-install,post-upgrade"
36+
"helm.sh/hook-weight": "1"
37+
name: capi-system
38+
---
39+
# Source: cluster-api-operator/templates/infra.yaml
40+
apiVersion: v1
41+
kind: Namespace
42+
metadata:
43+
annotations:
44+
"helm.sh/hook": "post-install,post-upgrade"
45+
"helm.sh/hook-weight": "1"
46+
"argocd.argoproj.io/sync-wave": "1"
47+
name: docker-infrastructure-system
48+
---
49+
# Source: cluster-api-operator/templates/addon.yaml
50+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
51+
kind: AddonProvider
52+
metadata:
53+
name: helm
54+
namespace: helm-addon-system
55+
annotations:
56+
"helm.sh/hook": "post-install,post-upgrade"
57+
"helm.sh/hook-weight": "2"
58+
"argocd.argoproj.io/sync-wave": "2"
59+
---
60+
# Source: cluster-api-operator/templates/bootstrap.yaml
61+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
62+
kind: BootstrapProvider
63+
metadata:
64+
name: kubeadm
65+
namespace: kubeadm-bootstrap-system
66+
annotations:
67+
"helm.sh/hook": "post-install,post-upgrade"
68+
"helm.sh/hook-weight": "2"
69+
---
70+
# Source: cluster-api-operator/templates/control-plane.yaml
71+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
72+
kind: ControlPlaneProvider
73+
metadata:
74+
name: kubeadm
75+
namespace: kubeadm-control-plane-system
76+
annotations:
77+
"helm.sh/hook": "post-install,post-upgrade"
78+
"helm.sh/hook-weight": "2"
79+
spec:
80+
manager:
81+
featureGates:
82+
ClusterTopology: true
83+
MachinePool: true
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,post-upgrade"
93+
"helm.sh/hook-weight": "2"
94+
"argocd.argoproj.io/sync-wave": "2"
95+
manager:
96+
---
97+
# Source: cluster-api-operator/templates/infra.yaml
98+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
99+
kind: InfrastructureProvider
100+
metadata:
101+
name: docker
102+
namespace: docker-infrastructure-system
103+
annotations:
104+
"helm.sh/hook": "post-install,post-upgrade"
105+
"helm.sh/hook-weight": "2"
106+
"argocd.argoproj.io/sync-wave": "2"
107+
spec:
108+
manager:

0 commit comments

Comments
 (0)