From c36e4e371f37f52efe800217c25590b4ea367e01 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sat, 21 Dec 2024 23:40:21 -0600 Subject: [PATCH] reorganize values --- charts/postgres-cluster/Chart.yaml | 2 +- charts/postgres-cluster/templates/_bootstrap.tpl | 14 +++++++------- charts/postgres-cluster/values.yaml | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 500caa7..d8f15cb 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 3.20.8 +version: 3.20.9 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 dca1892..965eb94 100644 --- a/charts/postgres-cluster/templates/_bootstrap.tpl +++ b/charts/postgres-cluster/templates/_bootstrap.tpl @@ -2,7 +2,7 @@ bootstrap: {{- if eq .Values.mode "standalone" }} initdb: - {{- with .Values.cluster.initdb }} + {{- with .Values.bootstrap.initdb }} {{- with (omit . "postInitApplicationSQL") }} {{- . | toYaml | nindent 4 }} {{- end }} @@ -29,7 +29,7 @@ bootstrap: - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA vectors TO "app"; - GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "app"; {{- end }} - {{- with .Values.cluster.initdb }} + {{- with .Values.bootstrap.initdb }} {{- range .postInitApplicationSQL }} {{- printf "- %s" . | nindent 6 }} {{- end }} @@ -37,11 +37,6 @@ bootstrap: {{- end }} {{- else if eq .Values.mode "replica" }} initdb: - {{- with .Values.cluster.initdb }} - {{- with (omit . "postInitApplicationSQL") }} - {{- . | toYaml | nindent 4 }} - {{- end }} - {{- end }} import: type: {{ .Values.replica.importType }} databases: @@ -66,6 +61,11 @@ bootstrap: {{- end }} source: externalCluster: "{{ include "cluster.name" . }}-cluster" + {{- with .Values.bootstrap.initdb }} + {{- with (omit . "postInitApplicationSQL") }} + {{- . | toYaml | nindent 4 }} + {{- end }} + {{- end }} externalClusters: - name: "{{ include "cluster.name" . }}-cluster" {{- with .Values.replica.externalCluster }} diff --git a/charts/postgres-cluster/values.yaml b/charts/postgres-cluster/values.yaml index c70cb60..a897cae 100644 --- a/charts/postgres-cluster/values.yaml +++ b/charts/postgres-cluster/values.yaml @@ -80,6 +80,7 @@ cluster: hot_standby_feedback: "on" shared_preload_libraries: [] +bootstrap: # BootstrapInitDB is the configuration of the bootstrap process when initdb is used. # See: https://cloudnative-pg.io/documentation/current/bootstrap/ # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-bootstrapinitdb