From e8024cde8d926ca0bdf1df6712cc9e30d90aa6e2 Mon Sep 17 00:00:00 2001 From: Julien Girardin Date: Tue, 8 Mar 2022 13:54:24 +0100 Subject: [PATCH] helm: fix storageClass parameters handling Test existence of parameters to avoid printing artifacts that break yaml Signed-off-by: Julien Girardin --- deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml | 4 +++- deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml | 4 +++- .../charts/rook-ceph-cluster/templates/cephobjectstore.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml index ad4938380..b7db65566 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephblockpool.yaml @@ -19,7 +19,9 @@ provisioner: {{ $root.Values.operatorNamespace }}.rbd.csi.ceph.com parameters: pool: {{ $blockpool.name }} clusterID: {{ $root.Release.Namespace }} -{{ toYaml $blockpool.storageClass.parameters | indent 2 }} +{{ with $blockpool.storageClass.parameters }} +{{ toYaml . | indent 2 }} +{{ end }} reclaimPolicy: {{ default "Delete" $blockpool.storageClass.reclaimPolicy }} allowVolumeExpansion: {{ default "true" $blockpool.storageClass.allowVolumeExpansion }} {{- if $blockpool.storageClass.mountOptions }} diff --git a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml index a6b9e94ae..bd94da158 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephfilesystem.yaml @@ -20,7 +20,9 @@ parameters: fsName: {{ $filesystem.name }} pool: {{ $filesystem.name }}-{{ default "data0" $filesystem.storageClass.pool }} clusterID: {{ $root.Release.Namespace }} -{{ toYaml $filesystem.storageClass.parameters | indent 2 }} +{{ with $filesystem.storageClass.parameters }} +{{ toYaml . | indent 2 }} +{{ end }} reclaimPolicy: {{ default "Delete" $filesystem.storageClass.reclaimPolicy }} allowVolumeExpansion: {{ default "true" $filesystem.storageClass.allowVolumeExpansion }} {{- if $filesystem.storageClass.mountOptions }} diff --git a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml index 21177f32b..90f5b152a 100644 --- a/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml +++ b/deploy/charts/rook-ceph-cluster/templates/cephobjectstore.yaml @@ -18,6 +18,8 @@ reclaimPolicy: {{ default "Delete" $objectstore.storageClass.reclaimPolicy }} parameters: objectStoreName: {{ $objectstore.name }} objectStoreNamespace: {{ $root.Release.Namespace }} -{{ toYaml $objectstore.storageClass.parameters | indent 2 }} +{{ with $objectstore.storageClass.parameters }} +{{ toYaml . | indent 2 }} +{{ end }} {{ end }} {{ end }}