Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --fail-on threshold support #156

Merged
merged 3 commits into from
Sep 21, 2020
Merged

add --fail-on threshold support #156

merged 3 commits into from
Sep 21, 2020

Conversation

wagoodman
Copy link
Contributor

Adds the following functionalities:

  • the ability to comb through the discovered vulnerabilities and set a non-0 exit code when a vulnerability at or above the given user threshold is found (provided by --fail-on).
  • a ExpectedErr struct for creating errors that are known to be produced from grype. There is room to expand this in the future.

Note: the drop in coverage is somewhat fictitious since a test was added in a package that has no existing tests.

Closes #129

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
grype/grypeerr/errors.go Show resolved Hide resolved
cmd/root.go Show resolved Hide resolved
grype/grypeerr/errors.go Show resolved Hide resolved
grype/grypeerr/errors.go Show resolved Hide resolved
cmd/root.go Show resolved Hide resolved
internal/ui/etui/ephemeral_tui.go Show resolved Hide resolved
internal/ui/etui/ephemeral_tui.go Show resolved Hide resolved
internal/ui/etui/ephemeral_tui.go Show resolved Hide resolved
internal/ui/etui/ephemeral_tui.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman merged commit f0f8f4b into main Sep 21, 2020
@wagoodman wagoodman deleted the add-fail-on-threshold branch September 21, 2020 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a switch for exiting non-zero if vulnerabilities are found
3 participants