MCPcopy Create free account
hub / github.com/helm/helm / makeDescriptorFilter

Function makeDescriptorFilter

internal/plugin/loader.go:240–253  ·  view source on GitHub ↗

makeDescriptorFilter creates a filter function from a descriptor Additional plugin filter criteria we wish to support can be added here

(descriptor Descriptor)

Source from the content-addressed store, hash-verified

238// makeDescriptorFilter creates a filter function from a descriptor
239// Additional plugin filter criteria we wish to support can be added here
240func makeDescriptorFilter(descriptor Descriptor) filterFunc {
241 return func(p Plugin) bool {
242 // If name is specified, it must match
243 if descriptor.Name != "" && p.Metadata().Name != descriptor.Name {
244 return false
245
246 }
247 // If type is specified, it must match
248 if descriptor.Type != "" && p.Metadata().Type != descriptor.Type {
249 return false
250 }
251 return true
252 }
253}
254
255// FindPlugin returns a single plugin that matches the descriptor
256func FindPlugin(dirs []string, descriptor Descriptor) (Plugin, error) {

Callers 2

FindPluginsFunction · 0.85
FindPluginFunction · 0.85

Calls 1

MetadataMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…