Storage: Read desired mode from config instead of feature flags (#88353)
* Read desired mode from config * Update playlist integration tests * Add mode 1 playlist integration tests * Add mode 0 dual writing to playlist integration tests * Add documentation for the different dual writing modes
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"gopkg.in/ini.v1"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
"github.com/grafana/grafana/pkg/extensions"
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/fs"
|
||||
@@ -384,6 +385,15 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
|
||||
_, err = grafanaComSection.NewKey("api_url", o.GrafanaComAPIURL)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
if o.DualWriterDesiredModes != nil {
|
||||
unifiedStorageMode, err := getOrCreateSection("unified_storage_mode")
|
||||
require.NoError(t, err)
|
||||
for k, v := range o.DualWriterDesiredModes {
|
||||
_, err = unifiedStorageMode.NewKey(k, fmt.Sprint(v))
|
||||
require.NoError(t, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
logSection, err := getOrCreateSection("database")
|
||||
require.NoError(t, err)
|
||||
@@ -431,6 +441,7 @@ type GrafanaOpts struct {
|
||||
QueryRetries int64
|
||||
APIServerStorageType string
|
||||
GrafanaComAPIURL string
|
||||
DualWriterDesiredModes map[string]grafanarest.DualWriterMode
|
||||
}
|
||||
|
||||
func CreateUser(t *testing.T, store db.DB, cfg *setting.Cfg, cmd user.CreateUserCommand) *user.User {
|
||||
|
||||
Reference in New Issue
Block a user