{{- if and (.Values.auth.enabled) (not .Values.auth.existingSecret) -}}
apiVersion: v1
kind: Secret
metadata:
  labels:
    app: {{ template "mailhog.name" . }}
    chart: {{ template "mailhog.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: {{ template "mailhog.authFileSecret" . }}
type: Opaque
data:
  {{ .Values.auth.fileName }}: {{ .Values.auth.fileContents | b64enc }}
{{- end -}}
