mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
fix(api): always sort shared silences
Prevent different order between requests, which can also break random tests
This commit is contained in:
@@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/prymitive/karma/internal/slices"
|
||||
)
|
||||
@@ -179,6 +180,8 @@ func (ag *APIAlertGroup) dedupSilences() {
|
||||
ag.Shared.Silences[cluster] = []string{}
|
||||
}
|
||||
ag.Shared.Silences[cluster] = append(ag.Shared.Silences[cluster], silenceID)
|
||||
// sort to have stable order of silences
|
||||
sort.Strings(ag.Shared.Silences[cluster])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user