fix(postgres): move tenant PostgreSQL to patched standard-trixie images

The chart pinned bare image tags, which are the system variant on Debian
bullseye. Upstream stopped building that variant, so the minors that fix
CVE-2026-116331 (18.7, 17.12, 16.16, 15.20, 14.25) are published for
bookworm and trixie only. The CVE is a type confusion in the min/max
aggregate optimisation that lets a role able to create objects run code
as the operating system user of the server, and tenants hold such roles.

Pin the patched minors on standard-trixie. The standard variant, because
backups go through the barman-cloud plugin and need none of the barman
binaries the system variant adds. trixie, because main is on it and
release-1.7 moves to it with the backport batch that carries this
change, so a 1.6 cluster that upgrades to such a 1.7 release does not
move its Debian release a second time. PostgreSQL 13 has no patched
release: it keeps 13.22 and moves to trixie with the rest.

For a running cluster this changes the Debian release under the data
directory. The init Job rebuilds the indexes that depend on a collation
whose library version changed.

release-1.6 has no postgis flavor, so its version map, its unit test and
the flavor guard are not carried over, and postgres.imageName has only
the postgresql branch.

(cherry picked from commit b40be51a6b)
Assisted-By: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
This commit is contained in:
Andrey Kolkov committed 2026-12-01 12:54:21 +07:00
1 parent 34a50b6bfa
commit eaecde82ad
5 files changed
+26 -14

No files matched your search

+5 -5
View File
@@ -1,6 +1,6 @@
"v18": "v18.1"
"v17": "v17.7"
"v16": "v16.11"
"v15": "v15.15"
"v14": "v14.20"
"v18": "v18.7"
"v17": "v17.12"
"v16": "v16.16"
"v15": "v15.20"
"v14": "v14.25"
"v13": "v13.22"
@@ -32,9 +32,10 @@ if ! command -v jq &> /dev/null; then
exit 1
fi
# Get available image tags
# Get available image tags. Only standard-trixie builds count: the chart
# appends that suffix to the minor it reads from versions.yaml.
echo "Fetching available image tags from registry..."
AVAILABLE_TAGS=$(skopeo list-tags docker://ghcr.io/cloudnative-pg/postgresql | jq -r '.Tags[] | select(test("^[0-9]+\\.[0-9]+$"))' | sort -V)
AVAILABLE_TAGS=$(skopeo list-tags docker://ghcr.io/cloudnative-pg/postgresql | jq -r '.Tags[] | select(test("^[0-9]+\\.[0-9]+-standard-trixie$")) | sub("-standard-trixie$"; "")' | sort -V)
if [ -z "$AVAILABLE_TAGS" ]; then
echo "Error: Could not fetch available image tags" >&2
@@ -6,3 +6,16 @@
{{- index $versionMap .Values.version }}
{{- end }}
{{/*
Single source for the operand image: the init Job runs psql against the
Cluster, so both must resolve the same image, and the Job compares its own
PostgreSQL build with the server's to tell when a new image has rolled out.
standard-trixie, not the bare tag: a bare tag is the system variant on
Debian bullseye, which upstream stopped building. The standard variant,
because backups go through the barman-cloud plugin and need none of the
barman binaries the system variant adds.
*/}}
{{- define "postgres.imageName" -}}
ghcr.io/cloudnative-pg/postgresql:{{ include "postgres.versionMap" . | trim | trimPrefix "v" }}-standard-trixie
{{- end -}}
+4 -6
View File
@@ -107,11 +107,9 @@ spec:
The S3/barman settings live in the barmancloud.cnpg.io/ObjectStore CR
rendered at the bottom of this file (named after the release); the
Cluster only references it by name. Native spec.backup.barmanObjectStore
is deprecated in CNPG 1.27 and removed in 1.29. The bare (system-flavor)
image tags this chart pins still ship the barman-cloud-* binaries the
native path needs (unlike the `standard` variant keycloak-db pins), but
the system flavor is deprecated upstream, so this chart moves to the
plugin as well.
is deprecated in CNPG 1.27 and removed in 1.29, and the standard image
variant this chart pins does not ship the barman-cloud-* binaries the
native path needs; the plugin runs them in a sidecar.
*/}}
{{- $hasInlineCreds := and (ne (default "" .Values.backup.s3AccessKey) "") (ne (default "" .Values.backup.s3SecretKey) "") }}
{{- $hasLegacyCreds := or $hasInlineCreds (ne (default "" $credCfg.name) "") }}
@@ -213,7 +211,7 @@ spec:
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 4 }}
imageName: ghcr.io/cloudnative-pg/postgresql:{{ include "postgres.versionMap" $ | trimPrefix "v" }}
imageName: {{ include "postgres.imageName" $ }}
enableSuperuserAccess: true
{{- if .Values._cluster.scheduling }}
{{- $rawConstraints := get .Values._cluster.scheduling "globalAppTopologySpreadConstraints" }}
@@ -47,7 +47,7 @@ spec:
restartPolicy: Never
containers:
- name: postgres
image: ghcr.io/cloudnative-pg/postgresql:{{ include "postgres.versionMap" $ | trimPrefix "v" }}
image: {{ include "postgres.imageName" $ }}
command:
- bash
- /scripts/init.sh