Alerting: Minor refactor to historan app RegisterAppInstaller. (#114828)

Splits the function in two so that NewAppInstaller can be used stanalone.
This commit is contained in:
Steve Simpson
2025-12-04 11:52:24 +00:00
committed by GitHub
parent 45cc410ab8
commit b71ed229f1
@@ -26,7 +26,6 @@ func RegisterAppInstaller(
cfg *setting.Cfg,
ng *ngalert.AlertNG,
) (*AlertingHistorianAppInstaller, error) {
installer := &AlertingHistorianAppInstaller{}
appSpecificConfig := historianAppConfig.RuntimeConfig{}
// If we're provided an AlertNG, then call back into that for things we need.
@@ -43,6 +42,12 @@ func RegisterAppInstaller(
appSpecificConfig.GetAlertStateHistoryHandler = handlers.GetAlertStateHistoryHandler
}
return NewAppInstaller(appSpecificConfig)
}
func NewAppInstaller(appSpecificConfig historianAppConfig.RuntimeConfig) (*AlertingHistorianAppInstaller, error) {
installer := &AlertingHistorianAppInstaller{}
provider := simple.NewAppProvider(apis.LocalManifest(), appSpecificConfig, historianApp.New)
appConfig := app.Config{