Skip to content

Commit d1a19d4

Browse files
committed
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>
1 parent 40725ae commit d1a19d4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cli-plugins/manager/manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ func ListPlugins(dockerCli config.Provider, rootcmd *cobra.Command) ([]Plugin, e
151151
}
152152

153153
candidates := listPluginCandidates(pluginDirs)
154+
if len(candidates) == 0 {
155+
return nil, nil
156+
}
154157

155158
var plugins []Plugin
156159
var mu sync.Mutex

0 commit comments

Comments
 (0)