mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 06:29:29 +01:00
fix: return the unmatched cases first, then perform the eviction
This commit is contained in:
@@ -99,9 +99,6 @@ func (o *Options) BuildFilterFunc() (FilterFunc, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return func(pod *v1.Pod) bool {
|
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) {
|
if len(o.includedNamespaces) > 0 && !o.includedNamespaces.Has(pod.Namespace) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -111,6 +108,9 @@ func (o *Options) BuildFilterFunc() (FilterFunc, error) {
|
|||||||
if s != nil && !s.Matches(labels.Set(pod.GetLabels())) {
|
if s != nil && !s.Matches(labels.Set(pod.GetLabels())) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if o.filter != nil && !o.filter(pod) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user