diff --git a/library/common-test/tests/cnpg/custom_conf_test.yaml b/library/common-test/tests/cnpg/custom_conf_test.yaml new file mode 100644 index 00000000..21109478 --- /dev/null +++ b/library/common-test/tests/cnpg/custom_conf_test.yaml @@ -0,0 +1,29 @@ +suite: cnpg custom conf test +templates: + - common.yaml +tests: + - it: should pass with custom-conf + set: + cnpg: + main: + enabled: true + primary: true + user: app + database: app + postgresql: + key1: value1 + key2: '{{ printf "test-tpl" }}' + asserts: + - documentIndex: &clusterDoc 0 + isKind: + of: Cluster + - documentIndex: *clusterDoc + isAPIVersion: + of: postgresql.cnpg.io/v1 + - documentIndex: *clusterDoc + isSubset: + path: spec + content: + postgresql: + key1: value1 + key2: test-tpl diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index baa1a4b2..997086e5 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 12.2.15 +version: 12.2.16 diff --git a/library/common/templates/class/_cnpgCluster.tpl b/library/common/templates/class/_cnpgCluster.tpl index b357cb22..f348d3d6 100644 --- a/library/common/templates/class/_cnpgCluster.tpl +++ b/library/common/templates/class/_cnpgCluster.tpl @@ -66,4 +66,7 @@ spec: inProgress: false reusePVC: on + postgresql: + {{- tpl ( $values.postgresql | toYaml ) $ | nindent 4 }} + {{- end -}} diff --git a/library/common/values.yaml b/library/common/values.yaml index ba2040b6..938a283c 100644 --- a/library/common/values.yaml +++ b/library/common/values.yaml @@ -708,6 +708,9 @@ cnpg: enablePodMonitor: true # -- contains credentials and urls output by generator creds: {} + # -- contains postgresql settings + # ref: https://cloudnative-pg.io/documentation/1.19/postgresql_conf/#the-postgresql-section + postgresql: {} # -- Redis dependency configuration # @default -- See below