diff --git a/packages/apps/postgres/files/versions.yaml b/packages/apps/postgres/files/versions.yaml index e4fe13ead..2624066e3 100644 --- a/packages/apps/postgres/files/versions.yaml +++ b/packages/apps/postgres/files/versions.yaml @@ -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" diff --git a/packages/apps/postgres/hack/update-versions.sh b/packages/apps/postgres/hack/update-versions.sh index c92b3895b..8567402a8 100755 --- a/packages/apps/postgres/hack/update-versions.sh +++ b/packages/apps/postgres/hack/update-versions.sh @@ -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 diff --git a/packages/apps/postgres/templates/_versions.tpl b/packages/apps/postgres/templates/_versions.tpl index ca0ff2a27..e81086303 100644 --- a/packages/apps/postgres/templates/_versions.tpl +++ b/packages/apps/postgres/templates/_versions.tpl @@ -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 -}} diff --git a/packages/apps/postgres/templates/db.yaml b/packages/apps/postgres/templates/db.yaml index 9cfb93def..a6a05b59a 100644 --- a/packages/apps/postgres/templates/db.yaml +++ b/packages/apps/postgres/templates/db.yaml @@ -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" }} diff --git a/packages/apps/postgres/templates/init-job.yaml b/packages/apps/postgres/templates/init-job.yaml index 7d99c36c9..af8c89af4 100644 --- a/packages/apps/postgres/templates/init-job.yaml +++ b/packages/apps/postgres/templates/init-job.yaml @@ -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