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 authored and GitHub committed 2022-07-06 16:22:59 +02:00
1 parent d122449a97
commit 40dff288cd
4 files changed
+103 -3

No files matched your search

+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