{{- if .Values.databaseSecret.create }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "datalore.databaseSecretName" . }}
  labels:
    {{- include "datalore.labels" . | nindent 4 }}
  {{- with .Values.databaseSecret.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
data:
  {{- $password := required "A valid .Values.databaseSecret.password entry required!" .Values.databaseSecret.password }}
  {{- b64enc $password | dict .Values.databaseSecret.key | toYaml | nindent 2 }}
{{- end }}
