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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user