Skip to content

Commit

Permalink
feat(cluster): Allowing a templated (tpl) cluster.initdb.owner value. (
Browse files Browse the repository at this point in the history
…cloudnative-pg#346)

Utilized the tpl function to evaluate the owner string as a template inside the Helm template.

---------

Signed-off-by: apriebeAVSystem <a.priebe+git@avsystem.com>
Co-authored-by: Itay Grudev <itay.grudev@essentim.com>
Signed-off-by: Zack Stevens <zack.st7@gmail.com>
  • Loading branch information
2 people authored and codelite7 committed Sep 24, 2024
1 parent 3680ee5 commit 63b1efa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion charts/cluster/templates/_bootstrap.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
bootstrap:
initdb:
{{- with .Values.cluster.initdb }}
{{- with (omit . "postInitApplicationSQL") }}
{{- with (omit . "postInitApplicationSQL" "owner") }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
{{- if .Values.cluster.initdb.owner }}
owner: {{ tpl .Values.cluster.initdb.owner . }}
{{- end }}
postInitApplicationSQL:
{{- if eq .Values.type "postgis" }}
- CREATE EXTENSION IF NOT EXISTS postgis;
Expand Down

0 comments on commit 63b1efa

Please sign in to comment.