cli-plugins/manager: ListPlugins: return early if no candidates

Skip the other logic, which includes listing all commands provided; if
there's no plugin-candidates, those steps won't be needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-03-18 11:46:37 +01:00
parent 40725aea3c
commit d1a19d4476
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -151,6 +151,9 @@ func ListPlugins(dockerCli config.Provider, rootcmd *cobra.Command) ([]Plugin, e
}
candidates := listPluginCandidates(pluginDirs)
if len(candidates) == 0 {
return nil, nil
}
var plugins []Plugin
var mu sync.Mutex