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