fix global alerts filter (#5311)

Signed-off-by: junot <junotxiang@kubesphere.io>

Signed-off-by: junot <junotxiang@kubesphere.io>
This commit is contained in:
junot
2022-10-21 21:48:42 +08:00
committed by GitHub
parent 77547147de
commit 1e79901241

View File

@@ -697,6 +697,9 @@ func (o *ruleGroupOperator) ListGlobalAlerts(ctx context.Context,
listResult := resources.DefaultList(alerts, queryParam, func(left, right runtime.Object, field query.Field) bool {
return o.compareAlert(&left.(*wrapAlert).Alert, &right.(*wrapAlert).Alert, field)
}, func(obj runtime.Object, filter query.Filter) bool {
if filter.Field == kapialertingv2beta1.FieldBuiltin { // ignoring this filter because it is filtered at the front
return true
}
return filterAlert(&obj.(*wrapAlert).Alert, filter)
})
for i := range listResult.Items {