MCPcopy Index your code
hub / github.com/helm/helm / FindPlugin

Function FindPlugin

internal/plugin/loader.go:256–271  ·  view source on GitHub ↗

FindPlugin returns a single plugin that matches the descriptor

(dirs []string, descriptor Descriptor)

Source from the content-addressed store, hash-verified

254
255// FindPlugin returns a single plugin that matches the descriptor
256func FindPlugin(dirs []string, descriptor Descriptor) (Plugin, error) {
257 loadAllIgnoreErrors := func(pluginsDir string) ([]Plugin, error) {
258 return LoadAllDir(pluginsDir, LogIgnorePluginLoadErrorFilterFunc)
259 }
260
261 plugins, err := findPlugins(dirs, loadAllIgnoreErrors, makeDescriptorFilter(descriptor))
262 if err != nil {
263 return nil, err
264 }
265
266 if len(plugins) > 0 {
267 return plugins[0], nil
268 }
269
270 return nil, fmt.Errorf("plugin: %+v not found", descriptor)
271}
272
273func detectDuplicates(plugs []Plugin) error {
274 names := map[string]string{}

Callers 1

NewPostRendererPluginFunction · 0.92

Calls 3

LoadAllDirFunction · 0.85
findPluginsFunction · 0.85
makeDescriptorFilterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…