From 668d50dfdbbf38d551dd8024a3c258a51ff420f5 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Thu, 4 Jul 2024 22:52:02 -0500 Subject: [PATCH] add conditional check for postinit --- charts/postgres-cluster/Chart.yaml | 2 +- charts/postgres-cluster/templates/_bootstrap.tpl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 01c1f4b..0ff7ec4 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 3.8.2 +version: 3.8.3 description: Chart for cloudnative-pg cluster keywords: - database diff --git a/charts/postgres-cluster/templates/_bootstrap.tpl b/charts/postgres-cluster/templates/_bootstrap.tpl index afc1974..944d08a 100644 --- a/charts/postgres-cluster/templates/_bootstrap.tpl +++ b/charts/postgres-cluster/templates/_bootstrap.tpl @@ -7,6 +7,7 @@ bootstrap: {{- . | toYaml | nindent 4 }} {{- end }} {{- end }} + {{- if or (eq .Values.type "postgis") (eq .Values.type "timescaledb") (.Values.cluster.initdb) }} postInitApplicationSQL: {{- if eq .Values.type "postgis" }} - CREATE EXTENSION IF NOT EXISTS postgis; @@ -21,6 +22,7 @@ bootstrap: {{- printf "- %s" . | nindent 6 }} {{- end }} {{- end }} + {{- end }} {{- else if eq .Values.mode "replica" }} initdb: import: