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

23 lines
567 B
Smarty
Raw Normal View History

2024-05-13 15:20:21 +00:00
{{- define "lib.config.env" -}}
{{- range $k, $v := .Values.env }}
{{- $customName := printf "%s-%s" (include "chart.fullname" $) $k }}
2024-07-15 17:48:53 +00:00
{{- if $v.enabled }}
2024-05-13 15:20:21 +00:00
---
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 }}
2024-07-15 06:34:25 +00:00
{{- range $key, $value := $v.data }}
2024-07-15 17:48:53 +00:00
{{- if $value }}
2024-07-15 06:37:48 +00:00
{{ $key }}: {{ $value | quote }}
2024-07-15 17:48:53 +00:00
{{- end }}
2024-05-13 15:20:21 +00:00
{{- end }}
{{- end }}
2024-07-15 17:48:53 +00:00
{{- end }}
{{- end -}}