ParseMetricSelector tries to copy label matchers but there is a new field re for the underlying regex and it is not copied, causing panic when calling Matches.
for i, lm := range vs.LabelMatchers {
matchers[i] = &labels.Matcher{
Type: lm.Type,
Name: lm.Name,
Value: lm.Value,
}
}
Verification
Added a simple unit test. Without the change in this PR the test will panic when calling Matches.
Changes
Fixes https://github.com/thanos-io/thanos/issues/7676
ParseMetricSelector
tries to copy label matchers but there is a new fieldre
for the underlying regex and it is not copied, causing panic when callingMatches
.Verification
Added a simple unit test. Without the change in this PR the test will panic when calling
Matches
.