Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
kahirokunn committed Dec 2, 2024
1 parent 52c29db commit 80c8b64
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/e2e/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
})
})
108 changes: 108 additions & 0 deletions test/e2e/resources/kubeadm-manager-defined.yaml
Original file line number Diff line number Diff line change
@@ -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:

0 comments on commit 80c8b64

Please sign in to comment.