Plugins: Remove bundled plugins feature (#96490)
* remove bundled plugins * Add echo to command Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com> * remove folder entirely * remove folder from CODEOWNERS --------- Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
This commit is contained in:
co-authored by
Andres Martinez Gotor
parent
ff032a61d5
commit
70fb7b9545
@@ -212,37 +212,28 @@ func TestPluginManager_Add_Remove(t *testing.T) {
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("Can't update core or bundled plugin", func(t *testing.T) {
|
||||
tcs := []struct {
|
||||
class plugins.Class
|
||||
}{
|
||||
{class: plugins.ClassCore},
|
||||
{class: plugins.ClassBundled},
|
||||
t.Run("Can't update core plugin", func(t *testing.T) {
|
||||
p := createPlugin(t, testPluginID, plugins.ClassCore, true, true, func(plugin *plugins.Plugin) {
|
||||
plugin.Info.Version = "1.0.0"
|
||||
})
|
||||
|
||||
reg := &fakes.FakePluginRegistry{
|
||||
Store: map[string]*plugins.Plugin{
|
||||
testPluginID: p,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tcs {
|
||||
p := createPlugin(t, testPluginID, tc.class, true, true, func(plugin *plugins.Plugin) {
|
||||
plugin.Info.Version = "1.0.0"
|
||||
})
|
||||
pm := New(reg, &fakes.FakeLoader{}, &fakes.FakePluginRepo{}, &fakes.FakePluginStorage{}, storage.SimpleDirNameGeneratorFunc, &fakes.FakeAuthService{})
|
||||
err := pm.Add(context.Background(), p.ID, "3.2.0", testCompatOpts())
|
||||
require.ErrorIs(t, err, plugins.ErrInstallCorePlugin)
|
||||
|
||||
reg := &fakes.FakePluginRegistry{
|
||||
Store: map[string]*plugins.Plugin{
|
||||
testPluginID: p,
|
||||
},
|
||||
}
|
||||
err = pm.Add(context.Background(), testPluginID, "", testCompatOpts())
|
||||
require.Equal(t, plugins.ErrInstallCorePlugin, err)
|
||||
|
||||
pm := New(reg, &fakes.FakeLoader{}, &fakes.FakePluginRepo{}, &fakes.FakePluginStorage{}, storage.SimpleDirNameGeneratorFunc, &fakes.FakeAuthService{})
|
||||
err := pm.Add(context.Background(), p.ID, "3.2.0", testCompatOpts())
|
||||
require.ErrorIs(t, err, plugins.ErrInstallCorePlugin)
|
||||
|
||||
err = pm.Add(context.Background(), testPluginID, "", testCompatOpts())
|
||||
require.Equal(t, plugins.ErrInstallCorePlugin, err)
|
||||
|
||||
t.Run(fmt.Sprintf("Can't uninstall %s plugin", tc.class), func(t *testing.T) {
|
||||
err = pm.Remove(context.Background(), p.ID, p.Info.Version)
|
||||
require.Equal(t, plugins.ErrUninstallCorePlugin, err)
|
||||
})
|
||||
}
|
||||
t.Run("Can't uninstall core plugin", func(t *testing.T) {
|
||||
err = pm.Remove(context.Background(), p.ID, p.Info.Version)
|
||||
require.Equal(t, plugins.ErrUninstallCorePlugin, err)
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("Can install multiple dependency levels", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user