1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +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

@@ -57,8 +57,9 @@ func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error)
excludedNamespaces = sets.NewString(nodeTaintsArgs.Namespaces.Exclude...)
}
// We can combine Filter and PreEvictionFilter since for this strategy it does not matter where we run PreEvictionFilter
podFilter, err := podutil.NewOptions().
WithFilter(handle.Evictor().Filter).
WithFilter(podutil.WrapFilterFuncs(handle.Evictor().Filter, handle.Evictor().PreEvictionFilter)).
WithNamespaces(includedNamespaces).
WithoutNamespaces(excludedNamespaces).
WithLabelSelector(nodeTaintsArgs.LabelSelector).