chore: a drop-in replacement for FeatureToggles.IsEnabledGlobally in app settings (#113449)
This commit is contained in:
@@ -76,7 +76,7 @@ func ProvideAppInstallers(
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesLogsDrilldown) {
|
||||
installers = append(installers, logsdrilldownAppInstaller)
|
||||
}
|
||||
//nolint:staticcheck
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesAnnotations) {
|
||||
installers = append(installers, annotationAppInstaller)
|
||||
}
|
||||
|
||||
@@ -510,6 +510,9 @@ type Cfg struct {
|
||||
// Query history
|
||||
QueryHistoryEnabled bool
|
||||
|
||||
// StartupSettings settings
|
||||
StartupSettings StartupSettings
|
||||
|
||||
// Open feature settings
|
||||
OpenFeature OpenFeatureSettings
|
||||
|
||||
@@ -1471,6 +1474,8 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
|
||||
// unified storage config
|
||||
cfg.setUnifiedStorageConfig()
|
||||
|
||||
// app platform config
|
||||
cfg.readStartupSettingsSection()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user