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

fix: vulnerabilities should be printed when --fail-on fails #1395

Merged
merged 5 commits into from
Jul 19, 2023

Conversation

willmurphyscode
Copy link
Contributor

Fixes #1392.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
Signed-off-by: Will Murphy <will.murphy@anchore.com>
"github.com/anchore/grype/internal/log"
)

// eventLoop listens to worker errors (from execution path), worker events (from a partybus subscription), and
// signal interrupts. Is responsible for handling each event relative to a given UI an to coordinate eventing until
// an eventual graceful exit.
func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription *partybus.Subscription, cleanupFn func(), uxs ...clio.UI) error {
func eventLoop(workerErrs <-chan error, signals <-chan os.Signal, subscription *partybus.Subscription, cleanupFn func(), uxs ...clio.UI) error { //nolint:gocognit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the nolint. I didn't see a great way to clean this up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this being nolint - it's legacy and meant to be stripped out eventually for the full cli refactor

@willmurphyscode willmurphyscode changed the title Restore output of vulnerabilities when --fail-on results in failure fix: vulnerabilities should be printed when --fail-on fails Jul 19, 2023
@@ -54,6 +54,14 @@ func TestCmd(t *testing.T) {
assertInOutput("scope: all-layers"),
},
},
{
name: "vulnerabilities in output on -f with failure",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks for the sanity check test here

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.

grype 0.64.0 doesn't list vulnerabilties if --fail-on fails
2 participants