feat(backup): pinned backup-tools image + egress allow list for the three nightly jobs #87

Merged
sirius merged 3 commits from wt/t_9d0428d8 into master 2026-12-04 05:20:44 +00:00
Showing only changes of commit d44ca50dd1 - Show all commits

ci(backup): take the pushed digest from buildx metadata, not imagetools

Forgejo's /v2/token answers 403 to the scope set buildx imagetools uses
(measured on this registry), while push and kubelet pull work. The metadata
file is the authoritative digest of the manifest the registry just accepted.
devops 2026-12-04 00:19:06 -05:00

View file

@ -52,24 +52,18 @@ jobs:
# --provenance=false --sbom=false: the tag must resolve to the single # --provenance=false --sbom=false: the tag must resolve to the single
# amd64 image manifest, so the digest a CronJob pins is exactly the # amd64 image manifest, so the digest a CronJob pins is exactly the
# image the pod runs (an index digest would resolve per-arch). # image the pod runs (an index digest would resolve per-arch).
# --metadata-file carries the pushed manifest digest. Do NOT read it
# back with `buildx imagetools inspect`: Forgejo's /v2/token answers
# 403 to that scope set (measured), while push and kubelet pull are
# fine.
docker buildx build --platform linux/amd64 \ docker buildx build --platform linux/amd64 \
--provenance=false --sbom=false \ --provenance=false --sbom=false \
-t "$image:$sha" \ -t "$image:$sha" \
--push images/backup --push --metadata-file /tmp/build-meta.json images/backup
echo "pushed $image:$sha" echo "pushed $image:$sha"
digest=$(tr -d '\n' < /tmp/build-meta.json \
- name: Print the digest to pin | sed -n 's/.*"containerimage\.digest": *"\(sha256:[a-f0-9]*\)".*/\1/p')
env: [ -n "$digest" ] || { echo "::error::no containerimage.digest in build metadata"; cat /tmp/build-meta.json; exit 1; }
REG_USER: ${{ secrets.REGISTRY_USER }}
REG_PASS: ${{ secrets.REGISTRY_TOKEN }}
run: |
set -euo pipefail
sha=$(git rev-parse HEAD)
image=forgejo.siriusdevops.com/sirius/backup-tools
user="${REG_USER:-sirius}"
pass="${REG_PASS:-${{ github.token }}}"
echo "$pass" | docker login forgejo.siriusdevops.com -u "$user" --password-stdin
digest=$(docker buildx imagetools inspect "$image:$sha" --format '{{.Manifest.Digest}}')
echo "BACKUP_TOOLS_DIGEST=$digest" echo "BACKUP_TOOLS_DIGEST=$digest"
{ {
echo "### Pin this in the three backup CronJob manifests" echo "### Pin this in the three backup CronJob manifests"