apiVersion: v1
kind: Secret
metadata:
  name: {{ template "suitecrm.fullname" . }}
  labels:
    app: {{ template "suitecrm.name" . }}
    chart: "{{ template "suitecrm.chart" . }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  {{ if .Values.suitecrmPassword }}
  suitecrm-password: {{ .Values.suitecrmPassword | b64enc | quote }}
  {{ else }}
  suitecrm-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{ end }}
  suitecrm-smtp-password: {{ default "" .Values.suitecrmSmtpPassword | b64enc | quote }}
