Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate equal empty string label matcher #144

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@
matchType := labels.MatchType(res)
switch matchType {
case labels.MatchEqual:
matcher = labels.MustNewMatcher(labels.MatchEqual, lbls[orders[i]].Name, lbls[orders[i]].Value)
val := lbls[orders[i]].Value
if s.rnd.Float64() > 0.9 {
val = ""
}
matcher = labels.MustNewMatcher(labels.MatchEqual, lbls[orders[i]].Name, val)
case labels.MatchNotEqual:
val := lbls[orders[i]].Value
if s.rnd.Float64() > 0.9 {
Expand Down Expand Up @@ -847,6 +851,6 @@
return lbls, stop
}

func randRange(min, max int) int {

Check failure on line 854 in walk.go

View workflow job for this annotation

GitHub Actions / lint

redefines-builtin-id: redefinition of the built-in function min (revive)
return rand.Intn(max-min) + min
}
Loading