Skip to content

Commit 73fd1fa

Browse files
committed
UNSO-1979: add value render template
1 parent 77d4379 commit 73fd1fa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

charts/sophora-ugc/templates/_helpers.tpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,16 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
9494
{{- end }}
9595
app.kubernetes.io/managed-by: {{ .Release.Service }}
9696
{{- end }}
97+
98+
{{/*
99+
Renders a value that contains template.
100+
Usage:
101+
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
102+
*/}}
103+
{{- define "common.tplvalues.render" -}}
104+
{{- if typeIs "string" .value }}
105+
{{- tpl .value .context }}
106+
{{- else }}
107+
{{- tpl (.value | toYaml) .context }}
108+
{{- end }}
109+
{{- end -}}

0 commit comments

Comments
 (0)