From 2b95d7bb34c0472ebb73ede35075473cff3a1e37 Mon Sep 17 00:00:00 2001 From: Christoph Witzko Date: Fri, 10 Feb 2023 12:30:11 +0100 Subject: [PATCH] fix: only batch prefetch more than one plugin --- pkg/plugin/discovery/discovery.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/plugin/discovery/discovery.go b/pkg/plugin/discovery/discovery.go index 4cd82a07..f077e9a5 100644 --- a/pkg/plugin/discovery/discovery.go +++ b/pkg/plugin/discovery/discovery.go @@ -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 {