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