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