fix: explicitly handle exhausted Trivy retries - #2339
Open
Yashh56 wants to merge 1 commit into
Open
Conversation
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This commit fixes a bug where exhausting all 10 Trivy retries would result in a confusing JSON parse error instead of the underlying execution error. It also cleans up a redundant condition inside the retry loop. Signed-off-by: Yash <yashsaini18166@gmail.com>
Yashh56
force-pushed
the
fix-trivy-retry-exhaustion
branch
from
September 7, 2026 15:06
c51bc23 to
e891e8c
Compare
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.
Changes
This PR fixes a bug in the image vulnerability scanning retry logic.
Previously, if all 10 retry attempts to download the Trivy vulnerability database failed, the loop would exit and incorrectly fall through to
json.Unmarshal. Because the output contained the plain text connection error instead of valid JSON, this would cause a confusing JSON parsing panic (invalid character...) that masked the real execution error.This PR:
i < 10check inside thefor i := 0; i < 10; i++loop.Related Issue
Fixes #2329
Type of PR
/kind bug
Submitter Checklist
Release Notes