Repository navigation
Retry rate-limited image pulls in the image audit - #2663
Merged
Merged
Conversation
Layer: 1-image-audit-pull-retry
Layer: 1-image-audit-pull-retry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The image audit failed twice on main today (run 45451874675, run 45457877831) because ECR Public answered the anonymous image pull with
TOOMANYREQUESTS: Data limit exceededduring a burst of merges. The scan never ran. Each run also fetched the image twice, once per Trivy step.User-facing: none
Each audit job now pulls its image once, retrying only on a rate limit, and both Trivy steps scan that local copy:
scripts/pullImage.shretries only whendocker pullreportstoomanyrequestsor429 Too Many Requests. Any other error fails at once. A rate limit that outlasts five attempts (150s of waiting) fails the job, so it never turns into a passing audit. The scan gates (severity,ignore-unfixed,exit-code) are untouched.Evidence
Before: a rate-limited pull failed the job on the first try, before any scan.
After:
scripts/pullImage.test.tsruns the script against a stubdockerwith both forms docker prints for a rate limit: it retries with doubling waits, fails after five attempts, and fails at once onmanifest unknown.Verified live: agent-tested the script with the real docker CLI against a local fake registry that always answers 429: five attempts, waits of 10, 20, 40 and 80 seconds, then exit 1. A registry that answers 404 failed at once with no retry.
Merge Danger
Door: two-way
Impact: CI-only
Only the image audit workflow changes.
actionlintwas not run.🤖 Written by an AI agent on my behalf.