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

@@ -29,6 +29,7 @@ import (
clientset "k8s.io/client-go/kubernetes"
schedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
type PreFilterPlugin struct {
@@ -197,7 +198,7 @@ func (fp *FilterPlugin) reset() {
// Filter is a test function that returns an error or nil, depending on the
// value of "failFilter".
func (fp *FilterPlugin) Filter(pc *framework.PluginContext, pod *v1.Pod, nodeName string) *framework.Status {
func (fp *FilterPlugin) Filter(pc *framework.PluginContext, pod *v1.Pod, nodeInfo *schedulernodeinfo.NodeInfo) *framework.Status {
fp.numFilterCalled++
if fp.failFilter {