1
0
mirror of https://github.com/docker/cli.git synced 2026-01-06 05:41:44 +03:00

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

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