mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(api): update cluster id on API query
This commit is contained in:
7
views.go
7
views.go
@@ -192,10 +192,13 @@ func alerts(c *gin.Context) {
|
||||
}
|
||||
|
||||
if len(agCopy.Alerts) > 0 {
|
||||
for _, alert := range agCopy.Alerts {
|
||||
for i, alert := range agCopy.Alerts {
|
||||
if alert.IsSilenced() {
|
||||
for _, am := range alert.Alertmanager {
|
||||
for j, am := range alert.Alertmanager {
|
||||
key := amNameToCluster[am.Name]
|
||||
// cluster might be wrong when collecting (races between fetches)
|
||||
// update is with current cluster discovery state
|
||||
agCopy.Alerts[i].Alertmanager[j].Cluster = key
|
||||
for _, silence := range am.Silences {
|
||||
_, found := silences[key][silence.ID]
|
||||
if !found {
|
||||
|
||||
Reference in New Issue
Block a user