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