Modified the Filter interface to pass in nodeinfo instead of node name.

This is necessary to support preemption, which relies on passing modified nodeinfo objects to the filters to simulate evicting lower-priority pods.
This commit is contained in:
Abdullah Gharaibeh
2019-09-18 15:48:26 -04:00
parent b8d8f1a35e
commit 89f936f6ac
8 changed files with 29 additions and 13 deletions

View File

@@ -311,9 +311,9 @@ func (f *framework) RunPreFilterPlugins(
// given node is not suitable for running pod.
// Meanwhile, the failure message and status are set for the given node.
func (f *framework) RunFilterPlugins(pc *PluginContext,
pod *v1.Pod, nodeName string) *Status {
pod *v1.Pod, nodeInfo *schedulernodeinfo.NodeInfo) *Status {
for _, pl := range f.filterPlugins {
status := pl.Filter(pc, pod, nodeName)
status := pl.Filter(pc, pod, nodeInfo)
if !status.IsSuccess() {
if !status.IsUnschedulable() {
errMsg := fmt.Sprintf("error while running %q filter plugin for pod %q: %v",