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 }}