FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382)

* Revert "FeatureToggles: register all enterprise feature toggles (#44336)"

This reverts commit f53b3fb007.

* Revert "FeatureFlags: manage feature flags outside of settings.Cfg (#43692)"

This reverts commit f94c0decbd.
This commit is contained in:
Agnès Toulet
2022-01-24 16:08:05 +01:00
committed by GitHub
parent 29268483c2
commit 65bdb3a899
66 changed files with 249 additions and 1324 deletions
@@ -85,6 +85,7 @@ func pluginScenario(t *testing.T, desc string, fn func(*testing.T, *PluginManage
t.Run("Given a plugin", func(t *testing.T) {
cfg := &setting.Cfg{
FeatureToggles: map[string]bool{},
PluginSettings: setting.PluginSettings{
"test-app": map[string]string{
"path": "testdata/test-app",
+1
View File
@@ -18,6 +18,7 @@ import (
func TestGetPluginDashboards(t *testing.T) {
cfg := &setting.Cfg{
FeatureToggles: map[string]bool{},
PluginSettings: setting.PluginSettings{
"test-app": map[string]string{
"path": "testdata/test-app",
@@ -17,7 +17,6 @@ import (
"github.com/grafana/grafana/pkg/plugins/backendplugin/provider"
"github.com/grafana/grafana/pkg/plugins/manager/loader"
"github.com/grafana/grafana/pkg/plugins/manager/signature"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/licensing"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/tsdb/azuremonitor"
@@ -51,13 +50,11 @@ func TestPluginManager_int_init(t *testing.T) {
bundledPluginsPath, err := filepath.Abs("../../../plugins-bundled/internal")
require.NoError(t, err)
features := featuremgmt.WithToggles()
cfg := &setting.Cfg{
Raw: ini.Empty(),
Env: setting.Prod,
StaticRootPath: staticRootPath,
BundledPluginsPath: bundledPluginsPath,
IsFeatureToggleEnabled: features.IsEnabled,
Raw: ini.Empty(),
Env: setting.Prod,
StaticRootPath: staticRootPath,
BundledPluginsPath: bundledPluginsPath,
PluginSettings: map[string]map[string]string{
"plugin.datasource-id": {
"path": "testdata/test-app",
@@ -82,7 +79,7 @@ func TestPluginManager_int_init(t *testing.T) {
otsdb := opentsdb.ProvideService(hcp)
pr := prometheus.ProvideService(hcp, tracer)
tmpo := tempo.ProvideService(hcp)
td := testdatasource.ProvideService(cfg, features)
td := testdatasource.ProvideService(cfg)
pg := postgres.ProvideService(cfg)
my := mysql.ProvideService(cfg, hcp)
ms := mssql.ProvideService(cfg)