fix(trivy): fail fast when trivy binary is not found - #1230
Open
AruneshDwivedi wants to merge 2 commits into
Open
fix(trivy): fail fast when trivy binary is not found#1230AruneshDwivedi wants to merge 2 commits into
AruneshDwivedi wants to merge 2 commits into
Conversation
When the trivy binary at /trivy cannot be found, the scanner previously logged an error and continued processing, silently swallowing the failure. This made it impossible to distinguish between a missing binary and a successful scan. Add a pre-flight os.Stat check in main() to exit immediately with a clear error message when the trivy binary is missing. Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
AruneshDwivedi
requested review from
ashnamehrotra,
pmengelbert and
sozercan
as code owners
August 15, 2026 07:24
- utils.GetConn: wrap grpc.DialContext with a 30-second timeout context so the collector/remover fail fast instead of hanging indefinitely when the CRI socket is inaccessible (fixes eraser-dev#1014) - trivy scanner: add pre-flight os.Stat check for /trivy binary in main() so the pod exits immediately with a clear error when the binary is missing instead of silently logging and continuing (fixes eraser-dev#1149) Fixes eraser-dev#1014 Fixes eraser-dev#1149 Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
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.
Fixes #1149
When the trivy binary at /trivy cannot be found, the scanner previously
logged an error and continued processing, silently swallowing the failure.
This made it impossible to distinguish between a missing binary and a
successful scan.
Add a pre-flight os.Stat check in main() to exit immediately with a
clear error message when the trivy binary is missing.