Alerting: add safeguard for migrations that might cause dataloss (#48526)

* Alerting: add safeguard for migrations that might cause dataloss

* add test for panic

* add documentation
This commit is contained in:
Jean-Philippe Quéméner
2022-05-02 10:38:42 +02:00
committed by GitHub
parent a5c570a5f6
commit 0a87ef06af
6 changed files with 37 additions and 0 deletions
+3
View File
@@ -386,6 +386,8 @@ type Cfg struct {
Env string
ForceMigration bool
// Analytics
CheckForGrafanaUpdates bool
CheckForPluginUpdates bool
@@ -886,6 +888,7 @@ func (cfg *Cfg) Load(args CommandLineArgs) error {
Env = valueAsString(iniFile.Section(""), "app_mode", "development")
cfg.Env = Env
cfg.ForceMigration = iniFile.Section("").Key("force_migration").MustBool(false)
InstanceName = valueAsString(iniFile.Section(""), "instance_name", "unknown_instance_name")
plugins := valueAsString(iniFile.Section("paths"), "plugins", "")
cfg.PluginsPath = makeAbsolute(plugins, HomePath)