apiVersion: v1
kind: Secret
metadata:
  name: {{ template "fullname" . }}
  labels:
    app: {{ template "fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  {{ if .Values.sentrySecret }}
  sentry-secret: {{ .Values.sentrySecret | b64enc | quote }}
  {{ else }}
  sentry-secret: {{ randAlphaNum 40 | b64enc | quote }}
  {{ end }}
  smtp-password: {{ default "" .Values.email.password | b64enc | quote }}
  {{ if .Values.user.password }}
  user-password: {{ .Values.user.password | b64enc | quote }}
  {{ else }}
  user-password: {{ randAlphaNum 16 | b64enc | quote }}
  {{ end }}
