Plugins: Remove direct featuremgmt.FeatureToggles dependency from plugins config (#84482)
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/registry"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/signature"
|
||||
"github.com/grafana/grafana/pkg/plugins/pfs"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginerrs"
|
||||
)
|
||||
|
||||
@@ -177,7 +176,7 @@ func NewAsExternalStep(cfg *config.PluginManagementCfg) *AsExternal {
|
||||
|
||||
// Filter will filter out any plugins that are marked to be disabled.
|
||||
func (c *AsExternal) Filter(cl plugins.Class, bundles []*plugins.FoundBundle) ([]*plugins.FoundBundle, error) {
|
||||
if c.cfg.Features == nil || !c.cfg.Features.IsEnabledGlobally(featuremgmt.FlagExternalCorePlugins) {
|
||||
if !c.cfg.Features.ExternalCorePluginsEnabled {
|
||||
return bundles, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/config"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/registry"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@@ -69,7 +68,9 @@ func TestAsExternal(t *testing.T) {
|
||||
|
||||
t.Run("should skip a core plugin", func(t *testing.T) {
|
||||
cfg := &config.PluginManagementCfg{
|
||||
Features: featuremgmt.WithFeatures(featuremgmt.FlagExternalCorePlugins),
|
||||
Features: config.Features{
|
||||
ExternalCorePluginsEnabled: true,
|
||||
},
|
||||
PluginSettings: setting.PluginSettings{
|
||||
"plugin1": map[string]string{
|
||||
"as_external": "true",
|
||||
|
||||
Reference in New Issue
Block a user