{{- if .Values.mariadb.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ printf "%s-%s" .Release.Name "db"  }}
  labels:
    app.kubernetes.io/name: {{ include "nextcloud.name" . }}
    helm.sh/chart: {{ include "nextcloud.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
  db-password: {{ default "" .Values.mariadb.db.password | b64enc | quote }}
  db-username: {{ default "" .Values.mariadb.db.user | b64enc | quote }}
{{- end }}
