diff --git a/test/e2e/helm_test.go b/test/e2e/helm_test.go index ff2409ae9..d381be617 100644 --- a/test/e2e/helm_test.go +++ b/test/e2e/helm_test.go @@ -261,4 +261,20 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func Expect(err).ToNot(HaveOccurred()) Expect(manifests).To(MatchYAML(string(expectedManifests))) }) + It("should deploy kubeadm control plane with manager specified", func() { + manifests, err := helmChart.Run(map[string]string{ + "core": "cluster-api", + "controlPlane": "kubeadm", + "bootstrap": "kubeadm", + "infrastructure": "docker", + "addon": "helm", + "manager.featureGates.kubeadm.ClusterTopology": "true", + "manager.featureGates.kubeadm.MachinePool": "true", + }) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).ToNot(BeEmpty()) + expectedManifests, err := os.ReadFile(filepath.Join(customManifestsFolder, "kubeadm-manager-defined.yaml")) + Expect(err).ToNot(HaveOccurred()) + Expect(manifests).To(MatchYAML(string(expectedManifests))) + }) }) diff --git a/test/e2e/resources/kubeadm-manager-defined.yaml b/test/e2e/resources/kubeadm-manager-defined.yaml new file mode 100644 index 000000000..d8c8dc5de --- /dev/null +++ b/test/e2e/resources/kubeadm-manager-defined.yaml @@ -0,0 +1,108 @@ +--- +# Source: cluster-api-operator/templates/addon.yaml +apiVersion: v1 +kind: Namespace +metadata: + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "1" + "argocd.argoproj.io/sync-wave": "1" + name: helm-addon-system +--- +# Source: cluster-api-operator/templates/bootstrap.yaml +apiVersion: v1 +kind: Namespace +metadata: + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "1" + name: kubeadm-bootstrap-system +--- +# Source: cluster-api-operator/templates/control-plane.yaml +apiVersion: v1 +kind: Namespace +metadata: + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "1" + name: kubeadm-control-plane-system +--- +# Source: cluster-api-operator/templates/core.yaml +apiVersion: v1 +kind: Namespace +metadata: + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "1" + name: capi-system +--- +# Source: cluster-api-operator/templates/infra.yaml +apiVersion: v1 +kind: Namespace +metadata: + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "1" + "argocd.argoproj.io/sync-wave": "1" + name: docker-infrastructure-system +--- +# Source: cluster-api-operator/templates/addon.yaml +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: AddonProvider +metadata: + name: helm + namespace: helm-addon-system + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "2" + "argocd.argoproj.io/sync-wave": "2" +--- +# Source: cluster-api-operator/templates/bootstrap.yaml +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: BootstrapProvider +metadata: + name: kubeadm + namespace: kubeadm-bootstrap-system + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "2" +--- +# Source: cluster-api-operator/templates/control-plane.yaml +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: ControlPlaneProvider +metadata: + name: kubeadm + namespace: kubeadm-control-plane-system + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "2" +spec: + manager: + featureGates: + ClusterTopology: true + MachinePool: true +--- +# Source: cluster-api-operator/templates/core.yaml +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: CoreProvider +metadata: + name: cluster-api + namespace: capi-system + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "2" + "argocd.argoproj.io/sync-wave": "2" + manager: +--- +# Source: cluster-api-operator/templates/infra.yaml +apiVersion: operator.cluster.x-k8s.io/v1alpha2 +kind: InfrastructureProvider +metadata: + name: docker + namespace: docker-infrastructure-system + annotations: + "helm.sh/hook": "post-install,post-upgrade" + "helm.sh/hook-weight": "2" + "argocd.argoproj.io/sync-wave": "2" +spec: + manager: \ No newline at end of file