FeatureFlags: Cleanup usage of cfg.IsFeatureToggleEnabled (#78014)

This commit is contained in:
Ryan McKinley
2023-11-13 07:55:15 -08:00
committed by GitHub
parent 2b146b97b4
commit 3509a5abb9
37 changed files with 147 additions and 211 deletions

View File

@@ -6,16 +6,17 @@ import (
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/setting"
)
func TestNewConfig(t *testing.T) {
cfg := setting.NewCfg()
// nolint:staticcheck
cfg := setting.NewCfgWithFeatures(featuremgmt.WithFeatures(featuremgmt.FlagGrafanaAPIServer).IsEnabled)
cfg.Env = setting.Prod
cfg.DataPath = "/tmp/grafana"
cfg.HTTPAddr = "10.0.0.1"
cfg.HTTPPort = "4000"
cfg.IsFeatureToggleEnabled = func(_ string) bool { return true }
cfg.AppURL = "http://test:4000"
section := cfg.Raw.Section("grafana-apiserver")