1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

fix: return the unmatched cases first, then perform the eviction

This commit is contained in:
googs1025
2024-06-22 18:16:40 +08:00
parent cdbd101eae
commit 6fdee47cbc

View File

@@ -99,9 +99,6 @@ func (o *Options) BuildFilterFunc() (FilterFunc, error) {
}
}
return func(pod *v1.Pod) bool {
if o.filter != nil && !o.filter(pod) {
return false
}
if len(o.includedNamespaces) > 0 && !o.includedNamespaces.Has(pod.Namespace) {
return false
}
@@ -111,6 +108,9 @@ func (o *Options) BuildFilterFunc() (FilterFunc, error) {
if s != nil && !s.Matches(labels.Set(pod.GetLabels())) {
return false
}
if o.filter != nil && !o.filter(pod) {
return false
}
return true
}, nil
}