Scopes: Add Filtering for ScopeDashoardBinding and Update Prometheus for ScopeFilterOperator Changes (#85284)

This commit is contained in:
Kyle Brandt
2024-03-27 11:39:55 -04:00
committed by GitHub
parent 7e1cd4397a
commit 136f8e6f0c
6 changed files with 61 additions and 21 deletions
+4 -4
View File
@@ -63,13 +63,13 @@ func scopeFiltersToMatchers(filters []ScopeFilter) ([]*labels.Matcher, error) {
for _, f := range filters {
var mt labels.MatchType
switch f.Operator {
case "=":
case FilterOperatorEquals:
mt = labels.MatchEqual
case "!=":
case FilterOperatorNotEquals:
mt = labels.MatchNotEqual
case "=~":
case FilterOperatorRegexMatch:
mt = labels.MatchRegexp
case "!~":
case FilterOperatorRegexNotMatch:
mt = labels.MatchNotRegexp
default:
return nil, fmt.Errorf("unknown operator %q", f.Operator)