Skip to content

Commit

Permalink
Adding != case
Browse files Browse the repository at this point in the history
Signed-off-by: alanprot <[email protected]>
  • Loading branch information
alanprot committed Jan 27, 2025
1 parent 7608ad2 commit f9908dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ func (s *PromQLSmith) walkLabelMatchers() []*labels.Matcher {
case labels.MatchEqual:
matcher = labels.MustNewMatcher(labels.MatchEqual, lbls[orders[i]].Name, lbls[orders[i]].Value)
case labels.MatchNotEqual:
matcher = labels.MustNewMatcher(labels.MatchNotEqual, lbls[orders[i]].Name, lbls[orders[i]].Value)
val := lbls[orders[i]].Value
if s.rnd.Float64() > 0.9 {
val = ""
}
matcher = labels.MustNewMatcher(labels.MatchNotEqual, lbls[orders[i]].Name, val)
case labels.MatchRegexp:
matcher = labels.MustNewMatcher(labels.MatchRegexp, lbls[orders[i]].Name, valF(lbls[orders[i]].Value))
case labels.MatchNotRegexp:
Expand Down

0 comments on commit f9908dc

Please sign in to comment.