helm-charts/charts/library/common/templates/lib/chart/_defaultKeepNonNullValue.tpl
2024-04-04 06:05:57 +00:00

13 lines
359 B
Smarty

{{/*
Return the value or the specified default if the given value is null.
*/}}
{{- define "bjw-s.common.lib.defaultKeepNonNullValue" -}}
{{- $value := .value -}}
{{- $default := required "default value is required" .default -}}
{{- if eq nil $value -}}
{{- $default | toYaml -}}
{{- else -}}
{{- $value | toYaml -}}
{{- end -}}
{{- end }}