diff --git a/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml b/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml index ce0f4dd929b..d633c04242c 100644 --- a/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml +++ b/charts/library/common-test/tests/cnpg/cluster_spec_test.yaml @@ -147,7 +147,8 @@ tests: tag: "15.6" global: fallbackDefaults: - pgVersion: 15 + cnpg: + pgVersion: 15 vctAccessModes: - ReadWriteMany - ReadWriteOnce diff --git a/charts/library/common/templates/class/cnpg/_cluster.tpl b/charts/library/common/templates/class/cnpg/_cluster.tpl index a949fff4cdd..ffc1b6ef6b0 100644 --- a/charts/library/common/templates/class/cnpg/_cluster.tpl +++ b/charts/library/common/templates/class/cnpg/_cluster.tpl @@ -24,6 +24,7 @@ {{- $logLevel := "info" -}} {{- $accessModes := $rootCtx.Values.global.fallbackDefaults.vctAccessModes -}} {{- $walAccessModes := $rootCtx.Values.global.fallbackDefaults.vctAccessModes -}} + {{- $skipEmptyWalArchiveCheck := $rootCtx.Values.global.fallbackDefaults.cnpg.skipEmptyWalArchiveCheck -}} {{/* Make sure keys exist before try to access any sub keys */}} {{- if not (hasKey $objectData "cluster") -}} @@ -140,6 +141,10 @@ {{- $walAccessModes = . -}} {{- end -}} + {{- with $objectData.cluster.skipEmptyWalArchiveCheck -}} + {{- $skipEmptyWalArchiveCheck = . -}} + {{- end -}} + {{- $imageName := $objectData.cluster.imageName -}} {{- if not $imageName -}} {{/* Ensure version and container tracking */}} @@ -171,6 +176,7 @@ metadata: annotations: cnpg.io/hibernation: {{ $hibernation | quote }} checksum/secrets: {{ toJson $rootCtx.Values.secret | sha256sum }} + cnpg.io/skipEmptyWalArchiveCheck: $skipEmptyWalArchiveCheck {{- $annotations := (mustMerge $clusterAnnotations (include "tc.v1.common.lib.metadata.allAnnotations" $rootCtx | fromYaml)) -}} {{- with (include "tc.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "annotations" $annotations) | trim) }} {{- . | nindent 4 }} diff --git a/charts/library/common/templates/spawner/_cnpg.tpl b/charts/library/common/templates/spawner/_cnpg.tpl index 0387f079160..40a0b11533e 100644 --- a/charts/library/common/templates/spawner/_cnpg.tpl +++ b/charts/library/common/templates/spawner/_cnpg.tpl @@ -24,7 +24,7 @@ {{- if eq $enabled "true" -}} {{/* Handle version string */}} - {{- $pgVersion := ($objectData.pgVersion | default $.Values.global.fallbackDefaults.pgVersion) | toString -}} + {{- $pgVersion := ($objectData.pgVersion | default $.Values.global.fallbackDefaults.cnpg.pgVersion) | toString -}} {{/* Set the updated pgVersion version to objectData */}} {{- $_ := set $objectData "pgVersion" $pgVersion -}} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index 84bfe163674..dedad3616dd 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -56,10 +56,13 @@ global: # -- Define a postgresql version for CNPG # will be used for all CNPG objects # Can be overruled per CNPG objects - pgVersion: 16 + # -- Define a topologyKey for default topologySpreadConstraints # Will be used when defaultSpread: true topologyKey: kubernetes.io/hostname + cnpg: + pgVersion: 16 + skipEmptyWalArchiveCheck: true metallb: # -- Adds metalLB annotations to services addServiceAnnotations: true @@ -1051,6 +1054,9 @@ cnpg: # set to true on single-node clusters to allow PVCs to be kept on instance restart singleNode: false + + ## set to configure the skipEmptyWalArchiveCheck annotation + # skipEmptyWalArchiveCheck: true # # -- storage size for the data pvc's # # Follows the same spec as .Values.Persistence type=PVC # storage: