mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-03 11:24:15 -03:00
add support for optional configmaps/secrets
This commit is contained in:
@@ -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 . -}}
|
||||
|
||||
Reference in New Issue
Block a user