Use dw dynamic config (#91882)

* Remove kubernetesPlaylists feature_toggle

* Remove unified_storage_mode

* Remove double import

* Read from config instead from feature_toggle

* cover scenario for when unified storage is not defined

* Be temporarily retro compatible with previous feature toggle

* Properly read unified_storage section

* [WIP] Read new format of config

* Fix test

* Fix other tests

* Generate feature flags file

* Use <group>.<resource> schema

* Use <group>.resource format on the FE as well

* Hide UniStore config from Frontend

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* unwanted changes

* Use feature toggles in the FE. Enforce FTs are present before enabling dual writing
Co-authored-by: Ryan McKinley <ryantxu@users.noreply.github.com>

* use kubernetes playlists feature toggle on the FE

* Remove unwanted code

* Remove configs from the FE

* Remove commented code

* Add more explicit example

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
Leonor Oliveira
2024-08-30 11:59:42 +02:00
committed by GitHub
co-authored by Ryan McKinley Maicon Costa
parent f8765087b5
commit 2e451b2ed7
12 changed files with 239 additions and 58 deletions
+11
View File
@@ -29,6 +29,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/apiserver/rest"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/util/osutil"
@@ -523,6 +524,13 @@ type Cfg struct {
//Short Links
ShortLinkExpiration int
// Unified Storage
UnifiedStorage map[string]UnifiedStorageConfig
}
type UnifiedStorageConfig struct {
DualWriterMode rest.DualWriterMode
}
type InstallPlugin struct {
@@ -1324,6 +1332,9 @@ func (cfg *Cfg) parseINIFile(iniFile *ini.File) error {
cfg.ScopesListScopesURL = scopesSection.Key("list_scopes_endpoint").MustString("")
cfg.ScopesListDashboardsURL = scopesSection.Key("list_dashboards_endpoint").MustString("")
// read unifed storage config
cfg.setUnifiedStorageConfig()
return nil
}