softplayer-helm-lib/charts/workload/templates/configs/_env.tpl

23 lines
567 B
Smarty

{{- define "lib.config.env" -}}
{{- range $k, $v := .Values.env }}
{{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }}
{{- if $v.enabled }}
---
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 $key, $value := $v.data }}
{{- if $value }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}