Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed May 15, 2024
1 parent 9c46aa2 commit da8bb81
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/vulnerability/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func clearTrivyCache(ctx context.Context, log *logp.Logger) error {
options := []flag.Options{
{CacheOptions: flag.CacheOptions{ClearCache: true}},
{DBOptions: flag.DBOptions{Reset: true}},
{MisconfOptions: flag.MisconfOptions{ResetPolicyBundle: true}},
// {MisconfOptions: flag.MisconfOptions{ResetPolicyBundle: true}},
}

errs := make([]error, 0, len(options))
Expand All @@ -94,13 +94,13 @@ func clearTrivyCache(ctx context.Context, log *logp.Logger) error {
if !errors.Is(err, artifact.SkipScan) {
errs = append(errs, err)
}
continue
}

// it should never go here (NewRunner should always return artifact.SkipScan), but just in case it goes, lets close the runner.
errs = append(errs, r.Close(ctx))
// it should never go here (NewRunner should always return artifact.SkipScan and nil runner), but just in case it goes, lets close the runner.
if r != nil {
errs = append(errs, r.Close(ctx))
}
}

log.Infof("Ending VulnerabilityRunner.ClearCache %d", len(errs))

return errors.Join(errs...)
Expand Down

0 comments on commit da8bb81

Please sign in to comment.