Alerting: Make Unified Alerting enabled by default for those who do not use legacy alerting (#42200)

* update AlertingEnabled and UnifiedAlertingSettings.Enabled to be pointers
* add a pseudo migration to fix the AlertingEnabled and UnifiedAlertingSettings.Enabled if the latter is not defined
* update the default configuration file to make default value for both 'enabled' flags be undefined

Misc
* update Migrator to expose DB engine. This is needed for a ualert migration to access the database while the list of migrations is created.
* add more verbose failure when migrations do not match

Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
This commit is contained in:
Armand Grillet
2021-11-24 14:56:07 -05:00
committed by GitHub
co-authored by gotjosh Yuriy Tseretyan gillesdemey
parent 1c261aea8e
commit 6523486122
19 changed files with 352 additions and 180 deletions
+1 -1
View File
@@ -386,7 +386,7 @@ func (hs *HTTPServer) registerRoutes() {
})
apiRoute.Get("/alert-notifiers", reqEditorRole, routing.Wrap(
GetAlertNotifiers(hs.Cfg.UnifiedAlerting.Enabled)),
GetAlertNotifiers(hs.Cfg.UnifiedAlerting.IsEnabled())),
)
apiRoute.Group("/alert-notifications", func(alertNotifications routing.RouteRegister) {