From ae884d7d1f5a557879c6315d60b05e778cc9187b Mon Sep 17 00:00:00 2001 From: Niladri Halder Date: Tue, 19 Mar 2024 17:02:47 +0530 Subject: [PATCH] refactor(charts): simplify CRD helm chart values Signed-off-by: Niladri Halder --- deploy/helm/charts/Chart.yaml | 1 - .../templates/csi-volume-snapshot-class.yaml | 2 +- .../csi-volume-snapshot-content.yaml | 2 +- .../crds/templates/csi-volume-snapshot.yaml | 2 +- .../charts/crds/templates/zfsbackup.yaml | 2 +- .../charts/charts/crds/templates/zfsnode.yaml | 2 +- .../charts/crds/templates/zfsrestore.yaml | 2 +- .../charts/crds/templates/zfssnapshot.yaml | 2 +- .../charts/crds/templates/zfsvolume.yaml | 2 +- deploy/helm/charts/charts/crds/values.yaml | 33 ++++--------------- deploy/helm/charts/values.yaml | 25 ++++---------- 11 files changed, 20 insertions(+), 55 deletions(-) diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index 5a873c4bc..4cf4817b3 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -17,7 +17,6 @@ sources: dependencies: - name: crds version: "2.5.0" - condition: crds.enabled maintainers: - name: xUnholy email: michaelfornaro@gmail.com diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml index cab4fd526..93258c3d2 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-class.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotClassesEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshotclasses.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml index 50003db40..ee98aa67f 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot-content.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotContentsEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshotcontents.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml index ee0920e3e..1b9c8b695 100644 --- a/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/csi-volume-snapshot.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.volumeSnapshots.enabled .Values.volumeSnapshots.snapshotsEnabled -}} +{{- if .Values.csi.volumeSnapshots.enabled -}} {{- $crdName := "volumesnapshots.snapshot.storage.k8s.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} apiVersion: apiextensions.k8s.io/v1 diff --git a/deploy/helm/charts/charts/crds/templates/zfsbackup.yaml b/deploy/helm/charts/charts/crds/templates/zfsbackup.yaml index 4ab149a63..6ad0a3edf 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsbackup.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsbackup.yaml @@ -1,4 +1,4 @@ -{{- if .Values.zfsBackups.enabled -}} +{{- if .Values.zfsLocalPv.enabled -}} {{- $crdName := "zfsbackups.zfs.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/zfsnode.yaml b/deploy/helm/charts/charts/crds/templates/zfsnode.yaml index 313c8be69..c64a436c1 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsnode.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsnode.yaml @@ -1,4 +1,4 @@ -{{- if .Values.zfsNodes.enabled -}} +{{- if .Values.zfsLocalPv.enabled -}} {{- $crdName := "zfsnodes.zfs.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml index 04fd889b7..40fb8c880 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml @@ -1,4 +1,4 @@ -{{- if .Values.zfsRestores.enabled -}} +{{- if .Values.zfsLocalPv.enabled -}} {{- $crdName := "zfsrestores.zfs.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml index f63f01c0e..57b1c8410 100644 --- a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml @@ -1,4 +1,4 @@ -{{- if .Values.zfsSnapshots.enabled -}} +{{- if .Values.zfsLocalPv.enabled -}} {{- $crdName := "zfssnapshots.zfs.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml index fbcc93ffa..8cbf3502b 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml @@ -1,4 +1,4 @@ -{{- if .Values.zfsVolumes.enabled -}} +{{- if .Values.zfsLocalPv.enabled -}} {{- $crdName := "zfsvolumes.zfs.openebs.io" -}} {{- if (include "crdIsAbsent" (list $crdName)) -}} ############################################## diff --git a/deploy/helm/charts/charts/crds/values.yaml b/deploy/helm/charts/charts/crds/values.yaml index 024d950e3..ed0476276 100644 --- a/deploy/helm/charts/charts/crds/values.yaml +++ b/deploy/helm/charts/charts/crds/values.yaml @@ -1,29 +1,8 @@ -zfsBackups: - # -- Install ZfsBackup CRD +zfsLocalPv: + # Install zfs-localpv CRDs enabled: true -zfsNodes: - # -- Install ZfsNode CRD - enabled: true - -zfsRestores: - # -- Install ZfsRestore CRD - enabled: true - -zfsSnapshots: - # -- Install ZfsSnapshot CRD - enabled: true - -zfsVolumes: - # -- Install ZfsVolume CRD - enabled: true - -volumeSnapshots: - # -- Install Volume Snapshot CRDs - enabled: true - # -- Install volumesnapshots.snapshot.storage.k8s.io CRD - snapshotsEnabled: true - # -- Install volumesnapshotclasses.snapshot.storage.k8s.io CRD - snapshotClassesEnabled: true - # -- Install volumesnapshotcontents.snapshot.storage.k8s.io CRD - snapshotContentsEnabled: true \ No newline at end of file +csi: + volumeSnapshots: + # Install Volume Snapshot CRDs + enabled: true \ No newline at end of file diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index 8d10fd275..3effec85c 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -174,23 +174,10 @@ zfs: bin: zfs crds: - # Enable/Disable all CRDs - enabled: true - zfsBackups: - # -- Install ZfsBackup CRD - enabled: true - zfsNodes: - # -- Install ZfsNode CRD - enabled: true - zfsRestores: - # -- Install ZfsRestore CRD - enabled: true - zfsSnapshots: - # -- Install ZfsSnapshot CRD - enabled: true - zfsVolumes: - # -- Install ZfsVolume CRD - enabled: true - volumeSnapshots: - # -- Install Volume Snapshot CRDs + zfsLocalPv: + # Install zfs-localpv CRDs enabled: true + csi: + volumeSnapshots: + # Install Volume Snapshot CRDs + enabled: true