Skip to content

fix: Add strategy to Nutanix CCM addon in examples #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/capi-quick-start/nutanix-cluster-calico-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds
strategy: HelmAddon
clusterAutoscaler:
strategy: ClusterResourceSet
cni:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds
strategy: HelmAddon
clusterAutoscaler:
strategy: HelmAddon
cni:
Expand Down
1 change: 1 addition & 0 deletions examples/capi-quick-start/nutanix-cluster-cilium-crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds
strategy: HelmAddon
clusterAutoscaler:
strategy: ClusterResourceSet
cni:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ spec:
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds
strategy: HelmAddon
clusterAutoscaler:
strategy: HelmAddon
cni:
Expand Down
1 change: 0 additions & 1 deletion hack/addons/kustomize/nutanix-ccm/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions hack/examples/patches/nutanix/ccm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
credentials:
secretRef:
name: ${CLUSTER_NAME}-pc-creds
strategy: HelmAddon
42 changes: 42 additions & 0 deletions test/e2e/ccm_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func WaitForCCMToBeReadyInWorkloadCluster(
workloadClusterClient,
input,
)
case "nutanix":
WaitForNutanixCCMToBeReadyInWorkloadCluster(
ctx,
workloadClusterClient,
input,
)
default:
Fail(
fmt.Sprintf(
Expand Down Expand Up @@ -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...)
}
Loading