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

add PreEvictionFilter extension to DefaultEvictor Plugin

This commit is contained in:
Lucas Severo Alves
2022-09-19 18:18:46 +02:00
parent 15045c5dcb
commit edec8fe010
14 changed files with 406 additions and 246 deletions

View File

@@ -215,7 +215,10 @@ func (d *RemovePodsViolatingTopologySpreadConstraint) Balance(ctx context.Contex
if !d.podFilter(pod) {
continue
}
d.handle.Evictor().Evict(ctx, pod, evictions.EvictOptions{})
if d.handle.Evictor().PreEvictionFilter(pod) {
d.handle.Evictor().Evict(ctx, pod, evictions.EvictOptions{})
}
if d.handle.Evictor().NodeLimitExceeded(nodeMap[pod.Spec.NodeName]) {
nodeLimitExceeded[pod.Spec.NodeName] = true
}