Repository navigation
Commit ad3bab3
committed
fix(ns8): tell a registry blip apart from a missing image in the manifest selftest
The registry-backed selftest failed on a TCP reset while reading an arm64 config
blob, and reported:
Failed to add docker://ghcr.io/calnode/ns8-calnode:build-arm64 to ...
If that tag does not exist in the registry, run build-images.sh with
TARGETARCH=arm64 PUSH=1 first.
The image existed. One connection dropped. That advice sends the reader to
rebuild and push an artefact that is already published, which is real, pointless
work, and the red build says nothing about the network.
Both halves are fixed where the truth is, in push-manifest.sh, because that is
the code that has buildah's actual error in hand. The workflow step only sees an
exit code, so wrapping it there would have meant guessing from a bare status.
RETRY. add_arch() retries `buildah manifest add` only when the error looks like a
transport failure: connection reset or refused, i/o timeout, deadline exceeded,
name resolution, no such host, unreachable network, TLS handshake, unexpected
EOF, 502/503/504, bad gateway, service unavailable, gateway timeout, internal
server error. Three attempts, 5s then 10s backoff, both overridable.
The classifier defaults to "real failure". Anything unrecognised fails on the
first attempt, immediately, with the existing message. That matters more than the
retry: an unfamiliar buildah error must never become a loop that hides a broken
release, and a genuine 404 must stay unmistakable.
MESSAGE. On a transport failure the script now says the registry was unreachable,
states explicitly that the tag was never reported absent, says nothing is wrong
with the build, and says not to rebuild. On a real absence it keeps the old
advice word for word, because there it is correct. The last lines of buildah's
own output are printed in both cases so the classification can be judged.
PROVEN with the real script and real buildah (docker run --privileged
quay.io/buildah/stable), not by injecting a raise:
happy path, registry, both arches exit 0, "Published ... (amd64 arm64)"
missing, nonexistent repository exit 1, 2s, old advice, no retries
missing, real repo, bad arch tag exit 1, 3s, old advice, no retries
("manifest unknown" from ghcr)
unreachable, localhost:1 exit 1, 15s, 2 retry lines then
"registry was unreachable", never the
missing-tag advice
hermetic selftest (SOURCE_PREFIX="") exit 0, unchanged
Worth recording from the second case: a nonexistent ghcr repository answers 403,
not 404, because the bearer-token request fails before any manifest lookup. It is
classified as a real failure by default, which is the right outcome, and it is
why the default matters.
No workflow change, no pin change, no permission change, no reformatting. One
file.1 parent fcf6c3d commit ad3bab3
1 file changed
Lines changed: 59 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
50 | 94 | | |
51 | 95 | | |
52 | 96 | | |
| |||
74 | 118 | | |
75 | 119 | | |
76 | 120 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
83 | 136 | | |
84 | 137 | | |
85 | 138 | | |
| |||
0 commit comments