Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 7969d1b

Browse files
committed
fix: adds snapshot to helm config
1 parent d3861d9 commit 7969d1b

File tree

6 files changed

+39
-12
lines changed

6 files changed

+39
-12
lines changed

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ data:
2020
defaultChartName: node-feature-discovery
2121
defaultChartVersion: 0.15.2
2222
defaultRepositoryUrl: https://kubernetes-sigs.github.io/node-feature-discovery/charts
23+
nutanix-snapshot-csi: |
24+
defaultChartName: nutanix-csi-snapshot
25+
defaultChartVersion: v6.3.2
26+
defaultRepositoryUrl: https://nutanix.github.io/helm/
2327
nutanix-storage-csi: |
2428
defaultChartName: nutanix-csi-storage
2529
defaultChartVersion: v2.6.6
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2023 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
7+
metadata:
8+
name: nutanix-csi-kustomize
9+
10+
namespace: kube-system
11+
12+
helmCharts:
13+
- name: nutanix-csi-snapshot
14+
repo: https://nutanix.github.io/helm/
15+
releaseName: nutanix-csi-storage
16+
version: ${NUTANIX_SNAPSHOT_CSI_CHART_VERSION}
17+
includeCRDs: true
18+
skipTests: true
19+
namespace: nutanix-system

make/addons.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export CLUSTER_AUTOSCALER_VERSION := 9.35.0
88
export AWS_CSI_SNAPSHOT_CONTROLLER_VERSION := v6.3.3
99
export AWS_EBS_CSI_CHART_VERSION := v2.28.1
1010
export NUTANIX_STORAGE_CSI_CHART_VERSION := v2.6.6
11+
export NUTANIX_SNAPSHOT_CSI_CHART_VERSION := v6.3.2
1112
# a map of AWS CCM versions
1213
export AWS_CCM_VERSION_127 := v1.27.1
1314
export AWS_CCM_CHART_VERSION_127 := 0.0.8

pkg/handlers/generic/lifecycle/config/cm.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import (
1717
type Component string
1818

1919
const (
20-
Autoscaler Component = "cluster-autoscaler"
21-
Tigera Component = "tigera-operator"
22-
Cilium Component = "cilium"
23-
NFD Component = "nfd"
24-
NutanixStorageCSI Component = "nutanix-storage-csi"
20+
Autoscaler Component = "cluster-autoscaler"
21+
Tigera Component = "tigera-operator"
22+
Cilium Component = "cilium"
23+
NFD Component = "nfd"
24+
NutanixStorageCSI Component = "nutanix-storage-csi"
25+
NutanixSnapshotCSI Component = "nutanix-snapshot-csi"
2526
)
2627

2728
type HelmChartGetter struct {

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ import (
2626
)
2727

2828
const (
29-
defaultHelmRepositoryURL = "https://nutanix.github.io/helm/"
3029
defaultStorageHelmReleaseNameTemplate = "nutanix-csi-storage-%s"
3130

32-
defaultSnapshotHelmChartVersion = "v6.3.2"
33-
defaultSnapshotHelmChartName = "nutanix-csi-snapshot"
3431
defaultSnapshotHelmReleaseNameTemplate = "nutanix-csi-snapshot-%s"
3532
)
3633

@@ -178,6 +175,11 @@ func (n *NutanixCSI) handleHelmAddonApply(
178175
return fmt.Errorf("failed to apply nutanix-csi installation HelmChartProxy: %w", err)
179176
}
180177

178+
snapshotHelmChart, err := n.helmChartInfoGetter.For(ctx, log, config.NutanixSnapshotCSI)
179+
if err != nil {
180+
return fmt.Errorf("failed to get values for nutanix-csi-config %w", err)
181+
}
182+
181183
snapshotChart := &caaphv1.HelmChartProxy{
182184
TypeMeta: metav1.TypeMeta{
183185
APIVersion: caaphv1.GroupVersion.String(),
@@ -188,14 +190,14 @@ func (n *NutanixCSI) handleHelmAddonApply(
188190
Name: "nutanix-csi-snapshot" + req.Cluster.Name,
189191
},
190192
Spec: caaphv1.HelmChartProxySpec{
191-
RepoURL: defaultHelmRepositoryURL,
192-
ChartName: defaultSnapshotHelmChartName,
193+
RepoURL: snapshotHelmChart.Repository,
194+
ChartName: snapshotHelmChart.Name,
193195
ClusterSelector: metav1.LabelSelector{
194196
MatchLabels: map[string]string{clusterv1.ClusterNameLabel: req.Cluster.Name},
195197
},
196198
ReleaseNamespace: req.Cluster.Namespace,
197199
ReleaseName: fmt.Sprintf(defaultSnapshotHelmReleaseNameTemplate, req.Cluster.Name),
198-
Version: defaultSnapshotHelmChartVersion,
200+
Version: snapshotHelmChart.Version,
199201
},
200202
}
201203

test/helpers/envtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type TestEnvironment struct {
5252
client.Client
5353
Config *rest.Config
5454
env *envtest.Environment
55-
_ context.CancelFunc
55+
cancel context.CancelFunc
5656
}
5757

5858
// Cleanup deletes all the given objects.

0 commit comments

Comments
 (0)