initial commit
This commit is contained in:
28
helm/templates/_tplvalues.tpl
Normal file
28
helm/templates/_tplvalues.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
{{- define "common.tplvalues.render" -}}
|
||||
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
|
||||
{{- if contains "{{" (toJson .value) }}
|
||||
{{- if .scope }}
|
||||
{{ tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
|
||||
{{- else }}
|
||||
{{ tpl $value .context }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{ $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "common.tplvalues.merge" }}
|
||||
{{- $dst := dict }}
|
||||
{{- range .values }}
|
||||
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst }}
|
||||
{{- end }}
|
||||
{{ $dst | toYaml }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "common.tplvalues.merge-overwrite" }}
|
||||
{{- $dst := dict }}
|
||||
{{- range .values }}
|
||||
{{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | mergeOverwrite $dst }}
|
||||
{{- end }}
|
||||
{{ $dst | toYaml }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user