Skip to content

Commit 8fa5cf2

Browse files
committed
refactor: Tidy up Nutanix CSI with consistent apply strategy
Move the current logic out to a helm addon strategy as done in other providers. Also move Helm release to kube-system to be consistent with other CSI providers. And tidy up flag names to use `--csi.nutanix.` prefix for flags, including wiring up to Helm chart values and deployment. Finally, add e2e test for CSI deployment in Nutanix infra.
1 parent df37085 commit 8fa5cf2

File tree

10 files changed

+372
-243
lines changed

10 files changed

+372
-243
lines changed

charts/cluster-api-runtime-extensions-nutanix/templates/deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ spec:
3333
- --helm-addons-configmap={{ .Values.helmAddonsConfigMap }}
3434
- --cni.cilium.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3535
- --nfd.helm-addon.default-values-template-configmap-name={{ .Values.hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
36-
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3736
- --csi.aws-ebs.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "aws-ebs").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
37+
- --csi.nutanix.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "nutanix").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
38+
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3839
{{- range $key, $value := .Values.extraArgs }}
3940
- --{{ $key }}={{ $value }}
4041
{{- end }}

hack/addons/kustomize/nutanix-snapshot-csi/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ helmCharts:
1616
version: ${NUTANIX_SNAPSHOT_CSI_CHART_VERSION}
1717
includeCRDs: true
1818
skipTests: true
19-
namespace: nutanix-system
19+
namespace: kube-system

hack/addons/kustomize/nutanix-storage-csi/kustomization.yaml.tmpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ helmCharts:
1414
repo: https://nutanix.github.io/helm-releases/
1515
releaseName: nutanix-csi-storage
1616
version: ${NUTANIX_STORAGE_CSI_CHART_VERSION}
17-
valuesFile: helm-values.yaml
1817
includeCRDs: true
1918
skipTests: true
20-
namespace: nutanix-system
19+
namespace: kube-system

pkg/handlers/generic/lifecycle/csi/awsebs/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (a *AWSEBS) Apply(
9292
client: a.client,
9393
}
9494
default:
95-
return fmt.Errorf("strategy %s not implemented", strategy)
95+
return fmt.Errorf("strategy %s not implemented", provider.Strategy)
9696
}
9797

9898
if err := strategy.apply(ctx, cluster, a.config.DefaultsNamespace(), log); err != nil {

pkg/handlers/generic/lifecycle/csi/localpath/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (l *LocalPathProvisionerCSI) Apply(
8787
client: l.client,
8888
}
8989
default:
90-
return fmt.Errorf("strategy %s not implemented", strategy)
90+
return fmt.Errorf("strategy %s not implemented", provider.Strategy)
9191
}
9292

9393
if err := strategy.apply(ctx, cluster, l.config.DefaultsNamespace(), log); err != nil {

pkg/handlers/generic/lifecycle/csi/nutanix-csi/handler.go

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)