apiVersion: v1
kind: Secret
metadata:
  name: {{ template "orangehrm.fullname" . }}
  labels:
    app: {{ template "orangehrm.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
type: Opaque
data:
  {{ if .Values.orangehrmPassword }}
  orangehrm-password: {{ default "" .Values.orangehrmPassword | b64enc | quote }}
  {{ else }}
  orangehrm-password: {{ list (lower (randAlpha 3)) (randNumeric 2) (upper (randAlpha 3)) | join "_" | b64enc | quote }}
  {{ end }}
  smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }}
