charts/postgres/templates/postgres-bootstrap-sql-configmap.yaml
{{- if .Values.databaseInitSQL }}
{{- $sqlConfigMap := (lookup "v1" "ConfigMap" .Release.Namespace .Values.databaseInitSQL.name ) }}
{{- if not $sqlConfigMap }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.databaseInitSQL.name }}
data:
bootstrap.sql:
{{ toYaml .Values.databaseInitSQL.sql | indent 2 }}
{{- end }}
{{- end }}