postfixadmin-charts/templates/postfixadmin/secrets.yaml

20 lines
510 B
YAML
Raw Normal View History

2021-09-26 18:33:17 +00:00
apiVersion: v1
kind: Secret
metadata:
name: {{ include "postfixadmin.fullname" . }}
type: Opaque
stringData:
{{- if not (hasKey .Values "config") -}}
{{- $_ := set .Values "config" dict -}}
{{- end -}}
{{- if not (hasKey .Values.config "POSTFIXADMIN_SETUP_PASSWORD") -}}
{{- $_ := set .Values.config "POSTFIXADMIN_SETUP_PASSWORD" (randAlphaNum 48 | quote ) -}}
{{- end -}}
{{/* SETUP CONFIG */}}
{{ range $key, $value := .Values.config }}
{{ upper $key}}: {{ quote $value }}
{{ end }}