{{- if and .Values.database.mysql.enabled (not .Values.database.mysql.auth.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: model-registry-db-secrets
type: Opaque
data:
  MYSQL_USER_NAME: {{ .Values.database.mysql.auth.username | b64enc | quote }}
  {{- if .Values.database.mysql.auth.rootPassword }}
  MYSQL_ROOT_PASSWORD: {{ .Values.database.mysql.auth.rootPassword | b64enc | quote }}
  {{- else }}
  MYSQL_ROOT_PASSWORD: {{ randAlphaNum 32 | b64enc | quote }}
  {{- end }}
{{- end }} 