{{- if .Values.authEnabled -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "neo4j.secrets.fullname" . }}
  labels:
    app: {{ template "neo4j.name" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
type: Opaque
data:
  {{- if .Values.neo4jPassword }}
  neo4j-password: {{ .Values.neo4jPassword | b64enc | quote }}
  {{- else }}
  neo4j-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
{{- end -}}
