Plugins: Add validation stage to plugin loader pipeline (#73053)
* first pass * change validation signature * err tracking * fix * undo golden * 1 more * fix * adjust doc * add test helper * fix linter
This commit is contained in:
@@ -486,6 +486,17 @@ func (f *FakeBootstrapper) Bootstrap(ctx context.Context, src plugins.PluginSour
|
||||
return []*plugins.Plugin{}, nil
|
||||
}
|
||||
|
||||
type FakeValidator struct {
|
||||
ValidateFunc func(ctx context.Context, ps []*plugins.Plugin) ([]*plugins.Plugin, error)
|
||||
}
|
||||
|
||||
func (f *FakeValidator) Validate(ctx context.Context, ps []*plugins.Plugin) ([]*plugins.Plugin, error) {
|
||||
if f.ValidateFunc != nil {
|
||||
return f.ValidateFunc(ctx, ps)
|
||||
}
|
||||
return []*plugins.Plugin{}, nil
|
||||
}
|
||||
|
||||
type FakeInitializer struct {
|
||||
IntializeFunc func(ctx context.Context, ps []*plugins.Plugin) ([]*plugins.Plugin, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user