Skip to content

Commit d8f1c75

Browse files
committed
use either toJson or quote on env vars based on type
1 parent c10ea5a commit d8f1c75

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

helm/templates/_helpers.tpl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,15 @@ Create the name of the service account to use
5757
{{- else }}
5858
{{- default "default" .Values.serviceAccount.name }}
5959
{{- end }}
60-
{{- end }}
60+
{{- end }}
61+
62+
{{/*
63+
Render env var value based on type
64+
*/}}
65+
{{- define "stac-auth-proxy.envValue" -}}
66+
{{- if kindIs "string" . -}}
67+
{{- . | quote -}}
68+
{{- else -}}
69+
{{- . | toJson | quote -}}
70+
{{- end -}}
71+
{{- end -}}

helm/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
env:
3333
{{- range $key, $value := .Values.env }}
3434
- name: {{ $key }}
35-
value: {{ $value | toJson | quote }}
35+
value: {{ include "stac-auth-proxy.envValue" $value }}
3636
{{- end }}
3737

3838
{{- with .Values.nodeSelector }}
@@ -46,4 +46,4 @@ spec:
4646
{{- with .Values.tolerations }}
4747
tolerations:
4848
{{- toYaml . | nindent 8 }}
49-
{{- end }}
49+
{{- end }}

0 commit comments

Comments
 (0)