{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ required ".Values.postgresql.initdbScriptsSecret is required" .Values.postgresql.initdbScriptsSecret }}
  annotations:
    "helm.sh/hook": "pre-install"
    "helm.sh/hook-delete-policy": "before-hook-creation"
type: Opaque
data:
  create-backend-dbs.sql: |
    {{ tpl (.Files.Get "files/create-backend-dbs.sql") . | b64enc }}
{{- end }}

