Skip to content

Commit

Permalink
retry in case of BLOB_UNKNOWN while downloading vulnerability list (#…
Browse files Browse the repository at this point in the history
…4300)

* retry in case of BLOB_UNKNOWN  while downloading vulnerability list

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
  • Loading branch information
nvuillam and nvuillam authored Nov 22, 2024
1 parent 7f790c0 commit e33c1c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- [csharpier](https://megalinter.io/latest/descriptors/csharp_csharpier/): They reverted v0.30 in v0.31, so we revert it too

- Fixes
- [trivy](https://megalinter.io/latest/descriptors/repository_trivy/): retry in case of BLOB_UNKNOWN while downloading vulnerability list

- Reporters
- Fix UpdatedSourcesReporter when `APPLY_FIXES` is list (array)
Expand Down
6 changes: 4 additions & 2 deletions megalinter/linters/TrivyLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class TrivyLinter(Linter):

def execute_lint_command(self, command):
return_code, return_output = super().execute_lint_command(command)
if ("TOOMANYREQUESTS" in return_output) or (
"failed to download Java DB" in return_output
if (
("TOOMANYREQUESTS" in return_output)
or ("failed to download Java DB" in return_output)
or ("BLOB_UNKNOWN" in return_output)
):
# Try 5 times
if self.counter < 5:
Expand Down

0 comments on commit e33c1c7

Please sign in to comment.