MCPcopy Create free account
hub / github.com/ddev/ddev / GetCLIPlugin

Function GetCLIPlugin

pkg/dockerutil/docker_manager.go:244–258  ·  view source on GitHub ↗

GetCLIPlugin returns the specified Docker CLI plugin by name, or an error if not found or if the plugin has an error.

(name string)

Source from the content-addressed store, hash-verified

242
243// GetCLIPlugin returns the specified Docker CLI plugin by name, or an error if not found or if the plugin has an error.
244func GetCLIPlugin(name string) (manager.Plugin, error) {
245 plugins, err := GetCLIPlugins()
246 if err != nil {
247 return manager.Plugin{}, err
248 }
249 for _, p := range plugins {
250 if p.Name == name {
251 if p.Err != nil {
252 return p, fmt.Errorf("plugin %q has error: %v", name, p.Err)
253 }
254 return p, nil
255 }
256 }
257 return manager.Plugin{}, fmt.Errorf("docker CLI plugin %q not found", name)
258}

Callers 2

GetBuildxVersionFunction · 0.85
GetBuildxLocationFunction · 0.85

Calls 2

GetCLIPluginsFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected