alertmanager/pkg/labels
sinkingpoint 6a072dbae3 Default the isEqual flag to true in alertmanager
Solves #2602 - the new version of alertmanager introduces an isEqual
flag to support != matchers in alertmanager silences. Clients set this
to true in the JSON blob sent to the api to indicate a foo=bar matcher,
and to false to indicate foo!=bar. Due to gos unmarshalling, anything
that _doesn't_ include this flag will default to false (i.e. a !=
matcher), so any clients that aren't aware of this flag (such as amtools
before negative matchers and the new api) will not send it, and when you
think you are making a foo=bar matcher, alertmanager will interpret that
as a not equals.

This commit changes the Unmarshaling of the v1matcher struct to default
the IsEqual flag to true, to keep the old behaviour for clients not
setting the flag

Signed-off-by: sinkingpoint <colin@quirl.co.nz>
2021-05-27 20:03:05 +10:00
..
matcher.go Default the isEqual flag to true in alertmanager 2021-05-27 20:03:05 +10:00
matcher_test.go Default the isEqual flag to true in alertmanager 2021-05-27 20:03:05 +10:00
parse.go Address code review comments 2021-01-13 18:49:06 +01:00
parse_test.go labels.Matcher: Add more test cases 2020-12-23 23:59:25 +01:00