Created
March 18, 2022 18:52
-
-
Save rgpower/3ba02c50bfa3abff3d37c185e76cdde5 to your computer and use it in GitHub Desktop.
add interpolation to env key/value pairs in values.yaml (helm)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| env: | |
| {{- if .Values.env -}} | |
| {{- if gt (len .Values.env) 0 -}} | |
| {{- range $k, $v := .Values.env }} | |
| {{- if kindIs "string" $v }} | |
| - name: {{ $k }} | |
| value: {{ tpl ($v | toString) $ | quote }} | |
| {{- else }} | |
| - name: {{ $v.name }} | |
| value: {{ tpl ($v.value | toString) $ | quote }} | |
| {{- end }} | |
| {{- else }} | |
| [] | |
| {{- end }} | |
| {{- end -}} | |
| {{- end -}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment