diff --git a/examples/capi-quick-start/nutanix-cluster-calico-crs.yaml b/examples/capi-quick-start/nutanix-cluster-calico-crs.yaml index c39a9a380..1b31ea277 100644 --- a/examples/capi-quick-start/nutanix-cluster-calico-crs.yaml +++ b/examples/capi-quick-start/nutanix-cluster-calico-crs.yaml @@ -67,6 +67,7 @@ spec: credentials: secretRef: name: ${CLUSTER_NAME}-pc-creds + strategy: HelmAddon clusterAutoscaler: strategy: ClusterResourceSet cni: diff --git a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml index 120f41567..c7c434e74 100644 --- a/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-calico-helm-addon.yaml @@ -67,6 +67,7 @@ spec: credentials: secretRef: name: ${CLUSTER_NAME}-pc-creds + strategy: HelmAddon clusterAutoscaler: strategy: HelmAddon cni: diff --git a/examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml b/examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml index 8e6fa2e14..5073709e0 100644 --- a/examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml +++ b/examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml @@ -67,6 +67,7 @@ spec: credentials: secretRef: name: ${CLUSTER_NAME}-pc-creds + strategy: HelmAddon clusterAutoscaler: strategy: ClusterResourceSet cni: diff --git a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml index 35b189961..a7b501a43 100644 --- a/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml +++ b/examples/capi-quick-start/nutanix-cluster-cilium-helm-addon.yaml @@ -67,6 +67,7 @@ spec: credentials: secretRef: name: ${CLUSTER_NAME}-pc-creds + strategy: HelmAddon clusterAutoscaler: strategy: HelmAddon cni: diff --git a/hack/addons/kustomize/nutanix-ccm/kustomization.yaml.tmpl b/hack/addons/kustomize/nutanix-ccm/kustomization.yaml.tmpl index 35753dd0f..54b0250e4 100644 --- a/hack/addons/kustomize/nutanix-ccm/kustomization.yaml.tmpl +++ b/hack/addons/kustomize/nutanix-ccm/kustomization.yaml.tmpl @@ -13,6 +13,5 @@ helmCharts: repo: https://nutanix.github.io/helm/ releaseName: nutanix-ccm version: ${NUTANIX_CCM_CHART_VERSION} - valuesFile: helm-values.yaml includeCRDs: true skipTests: true diff --git a/hack/examples/patches/nutanix/ccm.yaml b/hack/examples/patches/nutanix/ccm.yaml index 86ea7f74d..3d91b077d 100644 --- a/hack/examples/patches/nutanix/ccm.yaml +++ b/hack/examples/patches/nutanix/ccm.yaml @@ -7,3 +7,4 @@ credentials: secretRef: name: ${CLUSTER_NAME}-pc-creds + strategy: HelmAddon diff --git a/test/e2e/ccm_helpers.go b/test/e2e/ccm_helpers.go index e02dd2cd1..24798ac94 100644 --- a/test/e2e/ccm_helpers.go +++ b/test/e2e/ccm_helpers.go @@ -52,6 +52,12 @@ func WaitForCCMToBeReadyInWorkloadCluster( workloadClusterClient, input, ) + case "nutanix": + WaitForNutanixCCMToBeReadyInWorkloadCluster( + ctx, + workloadClusterClient, + input, + ) default: Fail( fmt.Sprintf( @@ -117,3 +123,39 @@ func WaitForAWSCCMToBeReadyInWorkloadCluster( }, }, input.DaemonSetIntervals...) } + +func WaitForNutanixCCMToBeReadyInWorkloadCluster( + ctx context.Context, + workloadClusterClient client.Client, + input WaitForCCMToBeReadyInWorkloadClusterInput, //nolint:gocritic // This hugeParam is OK in tests. +) { + switch input.CCM.Strategy { + case v1alpha1.AddonStrategyHelmAddon: + WaitForHelmReleaseProxyReadyForCluster( + ctx, + WaitForHelmReleaseProxyReadyForClusterInput{ + GetLister: input.ClusterProxy.GetClient(), + Cluster: input.WorkloadCluster, + HelmChartProxyName: "nutanix-ccm-" + input.WorkloadCluster.Name, + }, + input.HelmReleaseIntervals..., + ) + default: + Fail( + fmt.Sprintf( + "Do not know how to wait for Nutanix CCM using strategy %s to be ready", + input.CCM.Strategy, + ), + ) + } + + WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ + Getter: workloadClusterClient, + Deployment: &appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "nutanix-cloud-controller-manager", + Namespace: metav1.NamespaceSystem, + }, + }, + }, input.DeploymentIntervals...) +}