{{- if empty .Values.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "ghost.fullname" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
type: Opaque
data:
  {{- if .Values.ghostPassword }}
  ghost-password: {{ .Values.ghostPassword | b64enc | quote }}
  {{- else }}
  ghost-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
  {{- if .Values.smtpPassword }}
  smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }}
  {{- end }}
{{- end }}
