Skip to content

Commit

Permalink
fix: only batch prefetch more than one plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Feb 10, 2023
1 parent 9111603 commit 2b95d7b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/plugin/discovery/discovery.go
Expand Up @@ -124,10 +124,15 @@ func (d *Discovery) FindPluginsWithBatchResolver(resolverName string, pInfos []*
pInfo.BinPath = binPath
}

// no plugins need to be downloaded
if len(missingPlugins) == 0 {
return nil
}

if len(missingPlugins) == 1 {
return fmt.Errorf("no batch prefetching possible for a single plugin")
}

batchResolver := d.resolvers[resolverName].(resolver.BatchResolver)
batchDownloadInfo, err := batchResolver.BatchResolvePlugins(missingPlugins)
if err != nil {
Expand Down

0 comments on commit 2b95d7b

Please sign in to comment.