Plugins: Register management endpoints only when external managed is also false (#51802)

* Only define plugin install endpoints when catalog enabled

* add external check
This commit is contained in:
Will Browne
2022-07-06 16:22:59 +02:00
committed by GitHub
parent d122449a97
commit 40dff288cd
4 changed files with 103 additions and 3 deletions
+22
View File
@@ -6,6 +6,28 @@ import (
"github.com/grafana/grafana/pkg/plugins"
)
type fakePluginManager struct {
plugins map[string]fakePlugin
}
type fakePlugin struct {
pluginID string
version string
}
func (pm *fakePluginManager) Add(_ context.Context, pluginID, version string) error {
pm.plugins[pluginID] = fakePlugin{
pluginID: pluginID,
version: version,
}
return nil
}
func (pm *fakePluginManager) Remove(_ context.Context, pluginID string) error {
delete(pm.plugins, pluginID)
return nil
}
type fakePluginStore struct {
plugins.Store