From 4e62ab7f03c76e11fcaf275fd9609238c73aa604 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sat, 9 Mar 2024 23:08:26 +0200 Subject: [PATCH] take account how default works, and fix regression --- library/common-test/tests/cnpg/cluster_spec_test.yaml | 8 ++++---- .../templates/lib/cnpg/cluster/_bootstrapStandalone.tpl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/library/common-test/tests/cnpg/cluster_spec_test.yaml b/library/common-test/tests/cnpg/cluster_spec_test.yaml index 5dacac1b..a249dc3b 100644 --- a/library/common-test/tests/cnpg/cluster_spec_test.yaml +++ b/library/common-test/tests/cnpg/cluster_spec_test.yaml @@ -62,7 +62,7 @@ tests: name: test-release-name-common-test-cnpg-my-pg-user database: test-db owner: test-user - dataChecksums: false + dataChecksums: true - it: should override options set: @@ -80,7 +80,7 @@ tests: logLevel: debug instances: 3 initdb: - dataChecksums: true + dataChecksums: false encoding: some-encoding localeCollate: some-locale localeCtype: some-locale @@ -155,7 +155,7 @@ tests: name: test-release-name-common-test-cnpg-my-pg-user database: test-db owner: test-user - dataChecksums: true + dataChecksums: false encoding: some-encoding localeCollate: some-locale localeCtype: some-locale @@ -270,7 +270,7 @@ tests: name: test-release-name-common-test-cnpg-my-pg-user database: app owner: app - dataChecksums: false + dataChecksums: true postInitApplicationSQL: - CREATE EXTENSION IF NOT EXISTS some-extension; - CREATE EXTENSION IF NOT EXISTS timescaledb; diff --git a/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl b/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl index 764b3f7f..52de0208 100644 --- a/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl +++ b/library/common/templates/lib/cnpg/cluster/_bootstrapStandalone.tpl @@ -6,7 +6,7 @@ {{- $postInitSQL := list -}} {{- $postInitTemplateSQL := list -}} {{- $postInitApplicationSQL := list -}} - {{- $dataChecksums := false -}} + {{- $dataChecksums := true -}} {{- if not (hasKey $objectData.cluster "initdb") -}} {{- $_ := set $objectData.cluster "initdb" dict -}} {{- end -}} @@ -38,7 +38,7 @@ initdb: name: {{ printf "%s-user" $objectData.clusterName }} database: {{ $objectData.database }} owner: {{ $objectData.user }} - dataChecksums: {{ $dataChecksums | default true }} + dataChecksums: {{ $dataChecksums }} {{- with $objectData.cluster.initdb.encoding }} encoding: {{ . }} {{- end -}}