Plugins: Make Installer responsible for removing plugins from file system (#73323)

* installer is responsible for removing from file system

* take plugin as arg

* remove resolve step

* return plugin in test
This commit is contained in:
Will Browne
2023-08-16 15:44:20 +02:00
committed by GitHub
parent 243b757168
commit 3c50db328d
13 changed files with 64 additions and 106 deletions
+6 -3
View File
@@ -40,6 +40,9 @@ func TestPluginManager_Add_Remove(t *testing.T) {
require.Equal(t, []string{zipNameV1}, src.PluginURIs(ctx))
return []*plugins.Plugin{pluginV1}, nil
},
UnloadFunc: func(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error) {
return p, nil
},
}
pluginRepo := &fakes.FakePluginRepo{
@@ -129,9 +132,9 @@ func TestPluginManager_Add_Remove(t *testing.T) {
var unloadedPlugins []string
inst.pluginLoader = &fakes.FakeLoader{
UnloadFunc: func(_ context.Context, id string) error {
unloadedPlugins = append(unloadedPlugins, id)
return nil
UnloadFunc: func(_ context.Context, p *plugins.Plugin) (*plugins.Plugin, error) {
unloadedPlugins = append(unloadedPlugins, p.ID)
return p, nil
},
}