Skip to content

Commit

Permalink
Fix docker source to return any chunk errors (trufflesecurity#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina authored Jun 26, 2023
1 parent da5301e commit 945c27c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/engine/docker.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package engine

import (
"fmt"
"runtime"

"github.com/go-errors/errors"
Expand All @@ -25,14 +26,13 @@ func (e *Engine) ScanDocker(ctx context.Context, conn *anypb.Any) error {
return errors.WrapPrefix(err, "could not init docker source", 0)
}

e.sourcesWg.Add(1)
go func() {
e.sourcesWg.Go(func() error {
defer common.RecoverWithExit(ctx)
defer e.sourcesWg.Done()
err := dockerSource.Chunks(ctx, e.ChunksChan())
if err != nil {
ctx.Logger().Error(err, "error scanning docker image")
return fmt.Errorf("error scanning docker image: %w", err)
}
}()
return nil
})
return nil
}

0 comments on commit 945c27c

Please sign in to comment.