You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f7c3695
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packaging/ns8/push-manifest.sh
+59-6Lines changed: 59 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,50 @@ if [ "${#arches[@]}" -eq 0 ]; then
47
47
exit 1
48
48
fi
49
49
50
+
# A network blip and a missing image both come back as a failed `manifest add`,
51
+
# and telling them apart matters in both directions. Retrying a
52
+
# genuine 404 hides a build that never ran. Reporting a TCP reset as a missing
53
+
# tag sends the reader to rebuild and push an image that already exists, which
54
+
# is real pointless work: that is exactly what a reset during this script's CI
55
+
# selftest used to say.
56
+
#
57
+
# So: classify, retry only transport failures, and let the message name the case.
58
+
retry_attempts="${RETRY_ATTEMPTS:-3}"
59
+
retry_delay="${RETRY_DELAY:-5}"
60
+
61
+
# Transport failures. Deliberately a specific list rather than a broad "error"
62
+
# match, because the fallback has to stay fail-fast: anything we do not recognise
63
+
# is a real failure, not something to retry until the job times out.
64
+
is_network_error() {
65
+
grep -qiE 'connection reset|connection refused|i/o timeout|context deadline exceeded|timed out|temporary failure in name resolution|no such host|network is unreachable|tls handshake|unexpected eof|(^|[^0-9])(502|503|504)([^0-9]|$)|bad gateway|service unavailable|gateway timeout|internal server error'
66
+
}
67
+
68
+
# add_arch RETRIES the add, then records why it gave up in ADD_OUTPUT/ADD_KIND
69
+
# so the caller can print the right message. Returns 0 on success.
70
+
add_arch() {
71
+
local src="$1" attempt=1 delay="$retry_delay" output
72
+
while:;do
73
+
if output=$(buildah manifest add "${manifest}""${src}"2>&1);then
0 commit comments