Skip to content

Commit

Permalink
Try to reconnect broken providers before scan
Browse files Browse the repository at this point in the history
  • Loading branch information
jaym committed Aug 23, 2024
1 parent 6f13dd9 commit 0655683
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up
asset := batch[i].Asset
runtime := batch[i].Runtime

if err := runtime.EnsureProvidersConnected(); err != nil {

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / go-test

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected)

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / go-test

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected)

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / go-bench

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected)

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / golangci-lint

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected)) (typecheck)

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / golangci-lint

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected) (typecheck)

Check failure on line 417 in policy/scan/local_scanner.go

View workflow job for this annotation

GitHub Actions / golangci-lint

runtime.EnsureProvidersConnected undefined (type *providers.Runtime has no field or method EnsureProvidersConnected)) (typecheck)
log.Error().Err(err).Msg("could not connect to providers")
}

log.Debug().Interface("platform", asset.Platform).Str("name", asset.Name).Msg("start scan")

// Make sure the context has not been canceled in the meantime. Note that this approach works only for single threaded execution. If we have more than 1 thread calling this function,
Expand Down

0 comments on commit 0655683

Please sign in to comment.