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

Docker scan errors should be surfaced to the user beyond just logs #2827

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dustin-decker
Copy link
Contributor

@dustin-decker dustin-decker commented May 10, 2024

Description:

Currently if a Docker image scan fails due to invalid auth in TruffleHog Enterprise, the source integration is still showing as healthy because the error is not surfaced. This PR returns the errors.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@dustin-decker dustin-decker requested a review from a team as a code owner May 10, 2024 20:19
@@ -132,6 +132,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, _ .
_ = workers.Wait()
if scanErrs.Count() > 0 {
ctx.Logger().V(2).Info("scan errors", "errors", scanErrs.String())
return errors.New(scanErrs.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question: Are we certain this approach is what we want? Adopting this logic means any single error during the scan will lead to its failure. We've encountered this issue with other sources and found it detrimental to the user experience. However, the situation with the Docker source might be different, and perhaps we are willing to accept that trade-off

Copy link
Contributor

@rosecodym rosecodym May 13, 2024

Choose a reason for hiding this comment

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

As an alternative, implementing SourceUnitEnumChunker would provide a way to differentiate between fatal and non-fatal errors. It would be a little more work than adding this single line, but it doesn't look like it would be too much more, and it's work we want to do anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants