{{- define "lib.config.env" -}} {{- range $k, $v := .Values.env }} {{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }} --- apiVersion: v1 {{- if not $v.sensitive }} kind: ConfigMap {{- include "lib.metadata" (dict "Context" $ "customName" $customName)}} data: {{- else }} kind: Secret {{- include "lib.metadata" (dict "Context" $ "customName" $customName)}} stringData: {{- end }} {{- range $k, $v := $v.data }} {{ $k }}: {{ $v | quote }} {{- end }} {{- end }} {{- end -}}