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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sources/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Collaborator

@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.

}

return nil
Expand Down
Loading