add support for optional configmaps/secrets

This commit is contained in:
Kjeld Schouten
2023-06-02 12:18:00 +02:00
committed by GitHub
parent 522ca5ad79
commit 5816a83000

View File

@@ -20,7 +20,7 @@ objectData: The object data to be used to render the volume.
{{- if $expandName -}}
{{- $object := (get $rootCtx.Values.configmap $objectName) -}}
{{- if not $object -}}
{{- if and ( not $object ) ( not $objectData.optional ) -}}
{{- fail (printf "Persistence - Expected configmap [%s] defined in <objectName> to exist" $objectName) -}}
{{- end -}}
@@ -46,6 +46,9 @@ objectData: The object data to be used to render the volume.
{{- with $defMode }}
defaultMode: {{ . }}
{{- end -}}
{{- if $objectData.optional }}
optional: true
{{- end -}}
{{- with $objectData.items }}
items:
{{- range . -}}