Skip to content

Commit

Permalink
✨ re-use provider instance for all assets when scanning k8s
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Oct 4, 2023
1 parent 406c336 commit b56cf09
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions explorer/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,17 @@ func (s *LocalScanner) distributeJob(job *Job, ctx context.Context, upstream *up
for i := range assetCandidates {
candidate := assetCandidates[i]

runtime, err := providers.Coordinator.EphemeralRuntimeFor(candidate.asset)
if err != nil {
return nil, false, err
var runtime *providers.Runtime
if candidate.asset.Connections[0].Type == "k8s" {
runtime, err = providers.Coordinator.RuntimeFor(candidate.asset, providers.DefaultRuntime())
if err != nil {
return nil, false, err
}
} else {
runtime, err = providers.Coordinator.EphemeralRuntimeFor(candidate.asset)
if err != nil {
return nil, false, err
}
}
runtime.SetRecording(candidate.runtime.Recording)

Expand Down

0 comments on commit b56cf09

Please sign in to comment.