{{- if and .Values.auth.enabled .Values.auth.postgres.enabled (not .Values.auth.postgres.existingSecret.name) }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "mlflow.fullname" . }}-auth-pg-secret
  labels:
    app: {{ template "mlflow.name" . }}
    chart: {{ template "mlflow.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
type: Opaque
data:
  username: {{ required "auth.postgres.user must be specified" .Values.auth.postgres.user | b64enc }}
  password: {{ required "auth.postgres.password must be specified" .Values.auth.postgres.password | b64enc }}
{{- end }}
