Plugins: Refactor plugin config into separate env var and request scoped services (#83261)

* seperate services for env + req

* merge with main

* fix tests

* undo changes to golden file

* fix linter

* remove unused fields

* split out new config struct

* provide config

* undo go mod changes

* more renaming

* fix tests

* undo bra.toml changes

* update go.work.sum

* undo changes

* trigger

* apply PR feedback
This commit is contained in:
Will Browne
2024-02-27 12:38:02 +01:00
committed by GitHub
parent d04c579fc2
commit 5edd96ae77
62 changed files with 1933 additions and 1207 deletions
+15
View File
@@ -255,6 +255,21 @@ func (s *FakePluginStorage) Extract(ctx context.Context, pluginID string, dirNam
return &storage.ExtractedPluginArchive{}, nil
}
type FakePluginEnvProvider struct {
PluginEnvVarsFunc func(ctx context.Context, plugin *plugins.Plugin) []string
}
func NewFakePluginEnvProvider() *FakePluginEnvProvider {
return &FakePluginEnvProvider{}
}
func (p *FakePluginEnvProvider) PluginEnvVars(ctx context.Context, plugin *plugins.Plugin) []string {
if p.PluginEnvVarsFunc != nil {
return p.PluginEnvVarsFunc(ctx, plugin)
}
return []string{}
}
type FakeProcessManager struct {
StartFunc func(_ context.Context, p *plugins.Plugin) error
StopFunc func(_ context.Context, p *plugins.Plugin) error