Skip to content

Commit b4bd9cd

Browse files
jimmidysondkoshkin
andauthored
refactor: Tidy up Nutanix CSI with consistent apply strategy (#733)
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. Depends on #732. --------- Co-authored-by: Dimitri Koshkin <[email protected]>
1 parent 9e08ff9 commit b4bd9cd

File tree

10 files changed

+370
-243
lines changed

10 files changed

+370
-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
@@ -36,8 +36,9 @@ spec:
3636
- --helm-addons-configmap={{ .Values.helmAddonsConfigMap }}
3737
- --cni.cilium.helm-addon.default-values-template-configmap-name={{ .Values.hooks.cni.cilium.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
3838
- --nfd.helm-addon.default-values-template-configmap-name={{ .Values.hooks.nfd.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
39-
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4039
- --csi.aws-ebs.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "aws-ebs").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
40+
- --csi.nutanix.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "nutanix").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
41+
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4142
{{- range $key, $value := .Values.extraArgs }}
4243
- --{{ $key }}={{ $value }}
4344
{{- end }}

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

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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@ 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

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)