mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 05:37:53 +08:00
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:
@ -145,9 +145,17 @@ func (m *PluginInstaller) Remove(ctx context.Context, pluginID string) error {
|
||||
return plugins.ErrUninstallCorePlugin
|
||||
}
|
||||
|
||||
if err := m.pluginLoader.Unload(ctx, plugin.ID); err != nil {
|
||||
p, err := m.pluginLoader.Unload(ctx, plugin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if remover, ok := p.FS.(plugins.FSRemover); ok {
|
||||
if err = remover.Remove(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user