[common] allow the use of tpl's for envFrom (#822)

* allow the use of tpl's for envFrom

* actuall this is a feature increase
This commit is contained in:
Kjeld Schouten-Lebbing
2021-08-27 15:05:33 +02:00
committed by GitHub
parent aa67220de4
commit 91a4659c56
2 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -18,4 +18,4 @@ maintainers:
name: common name: common
sources: null sources: null
type: library type: library
version: 6.9.2 version: 6.10.0
@@ -40,6 +40,10 @@
secretKeyRef: secretKeyRef:
name: {{ tpl $value.secretKeyRef.name $ | quote }} name: {{ tpl $value.secretKeyRef.name $ | quote }}
key: {{ tpl $value.secretKeyRef.key $ | quote }} key: {{ tpl $value.secretKeyRef.key $ | quote }}
{{- else if $value.configMapRef }}
configMapRef:
name: {{ tpl $value.configMapRef.name $ | quote }}
key: {{ tpl $value.configMapRef.key $ | quote }}
{{- else }} {{- else }}
{{- $value | toYaml | nindent 8 }} {{- $value | toYaml | nindent 8 }}
{{- end }} {{- end }}
@@ -79,14 +83,22 @@
{{- end }} {{- end }}
{{- if or .Values.envFrom .Values.secret }} {{- if or .Values.envFrom .Values.secret }}
envFrom: envFrom:
{{- with .Values.envFrom }} {{- range $key, $value := .Values.envFrom }}
{{- toYaml . | nindent 4 }} {{- if $value.secretKeyRef }}
{{- end }} - secretKeyRef:
{{- if .Values.secret }} name: {{ tpl $value.secretKeyRef.name $ | quote }}
- secretRef: {{- else if $value.configMapRef }}
name: {{ include "common.names.fullname" . }} - configMapRef:
name: {{ tpl $value.configMapRef.name $ | quote }}
{- else }}
{{- toYaml $value | nindent 4 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.secret }}
- secretRef:
name: {{ include "common.names.fullname" . }}
{{- end }}
{{- end }}
{{- include "common.controller.ports" . | trim | nindent 2 }} {{- include "common.controller.ports" . | trim | nindent 2 }}
{{- with (include "common.controller.volumeMounts" . | trim) }} {{- with (include "common.controller.volumeMounts" . | trim) }}
volumeMounts: volumeMounts: