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

* Alerting: add safeguard for migrations that might cause dataloss

* add test for panic

* add documentation

(cherry picked from commit 0a87ef06af)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-05-02 11:12:39 +02:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent ae17f58a37
commit 3b40f18af1
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
@@ -884,6 +886,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)