feat: add unified storage data migration step for playlists (#114582)
* fix: add type * feat: register step * feat: add playlist support * test: add test case * fix: gen mock * fix: go gen * fix: lint * fix: lint * fix: tests * fix: add resource * fix: readd * fix: address comments * fix: independent playlist query for migrations * fix: remove lock logic for sqlite * fix: handle creation and update datetimes * fix: query templating * fix: simply resources and address comments
This commit is contained in:
@@ -8,9 +8,8 @@ import (
|
||||
"github.com/grafana/grafana/pkg/util/osutil"
|
||||
)
|
||||
|
||||
// nolint:unused
|
||||
var migratedUnifiedResources = []string{
|
||||
//"playlists.playlist.grafana.app",
|
||||
var MigratedUnifiedResources = []string{
|
||||
"playlists.playlist.grafana.app",
|
||||
"folders.folder.grafana.app",
|
||||
"dashboards.dashboard.grafana.app",
|
||||
}
|
||||
@@ -63,7 +62,7 @@ func (cfg *Cfg) setUnifiedStorageConfig() {
|
||||
if !cfg.DisableDataMigrations && cfg.getUnifiedStorageType() == "unified" {
|
||||
// Helper log to find instances running migrations in the future
|
||||
cfg.Logger.Info("Unified migration configs not yet enforced")
|
||||
//cfg.enforceMigrationToUnifiedConfigs() // TODO: uncomment when ready for release
|
||||
// cfg.enforceMigrationToUnifiedConfigs() // TODO: uncomment when ready for release
|
||||
} else {
|
||||
// Helper log to find instances disabling migration
|
||||
cfg.Logger.Info("Unified migration configs enforcement disabled", "storage_type", cfg.getUnifiedStorageType(), "disable_data_migrations", cfg.DisableDataMigrations)
|
||||
@@ -116,7 +115,7 @@ func (cfg *Cfg) enforceMigrationToUnifiedConfigs() {
|
||||
section.Key("enable_search").SetValue("true")
|
||||
cfg.EnableSearch = true
|
||||
}
|
||||
for _, resource := range migratedUnifiedResources {
|
||||
for _, resource := range MigratedUnifiedResources {
|
||||
cfg.Logger.Info("Enforcing mode 5 for resource in unified storage", "resource", resource)
|
||||
if oldCfg, ok := cfg.UnifiedStorage[resource]; ok {
|
||||
cfg.Logger.Info("Overriding unified storage config for migrated resource", "resource", resource, "old_config", oldCfg)
|
||||
|
||||
Reference in New Issue
Block a user