{{/* Get all environment variables configMaps and secrets that should be mounted as environment variables */}} {{- define "lib.parts.env" -}} {{/* environment variables from .Values.env */}} {{- range $name, $value := .Values.env -}} {{- printf "- name: %s" $name | nindent 0 }} {{- printf "value: %s" $value | nindent 2 }} {{- end -}} {{/* environment variables from configMaps */}} {{- range $cfgName, $settings := .Values.configs -}} {{- if and $settings.enabled $settings.env -}} {{- range $key, $value := $settings.data -}} {{- printf "- name: %s" $key | nindent 0 }} {{- printf "valueFrom:" | nindent 2 }} {{- printf "configMapKeyRef:" | nindent 4 }} {{- printf "name: %s" $key | nindent 5 }} {{- end }} {{- end }} {{- end -}} {{- end -}}