apiVersion: v1
kind: Secret
metadata:
  name: {{ template "nextcloud.fullname" . }}
  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:
  nextcloud-username: {{ .Values.nextcloud.username | b64enc | quote }}
  {{ if .Values.nextcloud.password }}
  nextcloud-password: {{ .Values.nextcloud.password | b64enc | quote }}
  {{ else }}
  nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{ end }}
  