Alerting: Implement GetStatus in the remote Alertmanager struct (#84887)
* Alerting: Implement GetStatus in the remote Alertmanager struct * update tests * fix tests, extract AlertmanagerConfig from PostableConfig * get the remote AM config instead of the Grafana one from the remote AM * pass grafana AM config in test * return error in GetStatus instead of logging it (internal AM)
This commit is contained in:
@@ -48,7 +48,12 @@ func (srv AlertmanagerSrv) RouteGetAMStatus(c *contextmodel.ReqContext) response
|
||||
return errResp
|
||||
}
|
||||
|
||||
status := am.GetStatus()
|
||||
status, err := am.GetStatus(c.Req.Context())
|
||||
if err != nil {
|
||||
srv.log.Error("Unable to get status for the alertmanager", "error", err)
|
||||
return ErrResp(http.StatusInternalServerError, err, "failed to get status for the Alertmanager")
|
||||
}
|
||||
|
||||
if !c.SignedInUser.HasRole(org.RoleAdmin) {
|
||||
notifier.RemoveAutogenConfigIfExists(status.Config.Route)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user