{{- if and .Values.postgres.enabled .Values.postgres.auth.password }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "papercrate.fullname" . }}-postgres
  labels:
    {{- include "papercrate.labels" . | nindent 4 }}
    app.kubernetes.io/component: postgres
type: Opaque
data:
  POSTGRES_USER: {{ .Values.postgres.auth.username | b64enc }}
  POSTGRES_PASSWORD: {{ .Values.postgres.auth.password | b64enc }}
{{- end }}
