mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-22 14:12:53 +00:00
Fix empty isEqual in amtool. (#2668)
This is the best we can do to make amtool support old releases. Supersedes #2634 Fix #2666 Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
3a9808c3f7
commit
e21cdfbc52
@ -52,6 +52,11 @@ func FormatDate(input strfmt.DateTime) string {
|
||||
|
||||
func labelsMatcher(m models.Matcher) *labels.Matcher {
|
||||
var t labels.MatchType
|
||||
// Support for older alertmanager releases, which did not support isEqual.
|
||||
if m.IsEqual == nil {
|
||||
isEqual := true
|
||||
m.IsEqual = &isEqual
|
||||
}
|
||||
switch {
|
||||
case !*m.IsRegex && *m.IsEqual:
|
||||
t = labels.MatchEqual
|
||||
|
Loading…
Reference in New Issue
Block a user