From 25b1845563ba5af14fadd4f6269117eb94714d40 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 29 Nov 2026 06:34:45 -0800 Subject: [PATCH 1/2] fix(postgres): query each platform's manifest digest in the pin bump The first scheduled-style run failed on the runner with "docker: cannot overwrite digest": the containerd image store will not pull one index digest for a second platform. Run each platform's own manifest digest instead, which also fails clearly if the base image drops a platform. Co-Authored-By: Claude Opus 5.5 --- build/package/postgres-bump.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build/package/postgres-bump.sh b/build/package/postgres-bump.sh index 618ec9ff..01ae8c02 100755 --- a/build/package/postgres-bump.sh +++ b/build/package/postgres-bump.sh @@ -66,8 +66,18 @@ done # Ask the new base image, once per published platform, which builds its pgdg # source offers now. pgdg can publish a build for one architecture before the # other, so a pin moves only to a version both offer. +# Each run uses the platform's own manifest digest: Docker's containerd image +# store refuses to pull one index digest for a second platform ("cannot +# overwrite digest"). candidates() { - docker run --rm --platform "$1" "$postgres_image" sh -c ' + local arch=${1#linux/} manifest + manifest=$(docker buildx imagetools inspect "$postgres_image" --raw | + jq -r --arg arch "$arch" '.manifests[] | select(.platform.os == "linux" and .platform.architecture == $arch) | .digest') + if [ -z "$manifest" ]; then + echo "$postgres_image has no linux/$arch image" >&2 + exit 1 + fi + docker run --rm --platform "$1" "${postgres_image%@*}@$manifest" sh -c ' apt-get update -qq >/dev/null || { echo "apt-get update failed" >&2; exit 1; } for package in "$@"; do printf "%s %s\n" "$package" "$(apt-cache policy "$package" | sed -n "s/^ *Candidate: //p")" From d8773e2e8c91bf6d69e2f79acf7718c54a5e4bda Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 29 Nov 2026 06:36:19 -0800 Subject: [PATCH 2/2] fix(postgres): read the index once and pick one digest per platform Address review: fetch the image index a single time and fail with the registry error when that fails, instead of reporting a missing platform. Take exactly one manifest per architecture, so a duplicate or variant entry cannot produce a multi-line image reference. Surface a failed candidate probe as its own error. Co-Authored-By: Claude Opus 5.5 --- build/package/postgres-bump.sh | 38 ++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/build/package/postgres-bump.sh b/build/package/postgres-bump.sh index 01ae8c02..31d8e02e 100755 --- a/build/package/postgres-bump.sh +++ b/build/package/postgres-bump.sh @@ -68,23 +68,39 @@ done # other, so a pin moves only to a version both offer. # Each run uses the platform's own manifest digest: Docker's containerd image # store refuses to pull one index digest for a second platform ("cannot -# overwrite digest"). +# overwrite digest"). The index is read once. +if ! index=$(docker buildx imagetools inspect "$postgres_image" --raw); then + echo "could not read the image index for $postgres_image" >&2 + exit 1 +fi +platform_digest() { + jq -er --arg arch "$1" \ + 'first(.manifests[]? | select(.platform.os == "linux" and .platform.architecture == $arch) | .digest)' \ + <<<"$index" +} candidates() { - local arch=${1#linux/} manifest - manifest=$(docker buildx imagetools inspect "$postgres_image" --raw | - jq -r --arg arch "$arch" '.manifests[] | select(.platform.os == "linux" and .platform.architecture == $arch) | .digest') - if [ -z "$manifest" ]; then - echo "$postgres_image has no linux/$arch image" >&2 - exit 1 - fi - docker run --rm --platform "$1" "${postgres_image%@*}@$manifest" sh -c ' + docker run --rm --platform "linux/$1" "${postgres_image%@*}@$2" sh -c ' apt-get update -qq >/dev/null || { echo "apt-get update failed" >&2; exit 1; } for package in "$@"; do printf "%s %s\n" "$package" "$(apt-cache policy "$package" | sed -n "s/^ *Candidate: //p")" done' sh "${names[@]}" } -amd64=$(candidates linux/amd64) -arm64=$(candidates linux/arm64) +amd64="" +arm64="" +for arch in amd64 arm64; do + if ! digest=$(platform_digest "$arch"); then + echo "$postgres_image has no linux/$arch image" >&2 + exit 1 + fi + if ! result=$(candidates "$arch" "$digest"); then + echo "could not list pgdg candidates for linux/$arch" >&2 + exit 1 + fi + case "$arch" in + amd64) amd64=$result ;; + arm64) arm64=$result ;; + esac +done for entry in "${packages[@]}"; do name=${entry%%=*}