From 39c562a911a0a7dc3663223adbcd92cc33fb18be Mon Sep 17 00:00:00 2001 From: Denis Vodopianov Date: Thu, 18 Dec 2025 22:46:32 +0100 Subject: [PATCH] Revert: chore: a drop-in replacement for FeatureToggles.IsEnabledGlobally in app settings (#115593) * Revert "chore: a drop-in replacement for FeatureToggles.IsEnabledGlobally in app settings (#113449)" This reverts commit 26ce2c09d78706e4235cc378d67da9f99c6ba99d. * Change FeatureToggles.IsEnabledGlobally deprecation message --- pkg/registry/apps/apps.go | 2 +- pkg/services/featuremgmt/models.go | 4 +--- pkg/setting/setting.go | 5 ----- pkg/setting/startup_setting.go | 14 -------------- 4 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 pkg/setting/startup_setting.go diff --git a/pkg/registry/apps/apps.go b/pkg/registry/apps/apps.go index 77c96fd437c..a1ec8aafd65 100644 --- a/pkg/registry/apps/apps.go +++ b/pkg/registry/apps/apps.go @@ -76,7 +76,7 @@ func ProvideAppInstallers( if features.IsEnabledGlobally(featuremgmt.FlagKubernetesLogsDrilldown) { installers = append(installers, logsdrilldownAppInstaller) } - //nolint:staticcheck // not yet migrated to OpenFeature + //nolint:staticcheck if features.IsEnabledGlobally(featuremgmt.FlagKubernetesAnnotations) { installers = append(installers, annotationAppInstaller) } diff --git a/pkg/services/featuremgmt/models.go b/pkg/services/featuremgmt/models.go index 304d17ee075..d59dff63c37 100644 --- a/pkg/services/featuremgmt/models.go +++ b/pkg/services/featuremgmt/models.go @@ -23,9 +23,7 @@ type FeatureToggles interface { // a full server restart for a change to take place. // // Deprecated: FeatureToggles.IsEnabledGlobally is deprecated and will be removed in a future release. - // Toggles that must be reliably evaluated at the service startup should be - // changed to settings (see setting.StartupSettings), and/or removed entirely. - // For app registration please use `grafana-apiserver.runtime_config` in settings.ini + // Toggles that must be reliably evaluated at the service startup should be changed to settings and/or removed entirely. IsEnabledGlobally(flag string) bool // Get the enabled flags -- this *may* also include disabled flags (with value false) diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 62b9332581f..00bcdabd88d 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -511,9 +511,6 @@ type Cfg struct { // Query history QueryHistoryEnabled bool - // StartupSettings settings - StartupSettings StartupSettings - // Open feature settings OpenFeature OpenFeatureSettings @@ -1476,8 +1473,6 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error { // unified storage config cfg.setUnifiedStorageConfig() - // app platform config - cfg.readStartupSettingsSection() return nil } diff --git a/pkg/setting/startup_setting.go b/pkg/setting/startup_setting.go deleted file mode 100644 index 8b2c2fa6362..00000000000 --- a/pkg/setting/startup_setting.go +++ /dev/null @@ -1,14 +0,0 @@ -package setting - -type StartupSettings struct { - KubernetesAnnotationsAppEnabled bool -} - -func (cfg *Cfg) readStartupSettingsSection() { - settings := StartupSettings{} - - startupSettingsSection := cfg.Raw.Section("startup_settings") - settings.KubernetesAnnotationsAppEnabled = startupSettingsSection.Key("annotations_app_enabled").MustBool(false) - - cfg.StartupSettings = settings -}