helm: fix storageClass parameters handling

Test existence of parameters to avoid printing artifacts that
break yaml
Signed-off-by: Julien Girardin <jugirardin@free.fr>
This commit is contained in:
Julien Girardin
2022-03-08 23:01:57 +01:00
parent 235781e28a
commit e8024cde8d
3 changed files with 9 additions and 3 deletions
@@ -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 }}
@@ -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 }}
@@ -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 }}