Unroll PreemptHandle to Handle

This commit is contained in:
drfish
2021-02-27 00:44:05 +08:00
parent 43e8405d9c
commit 38ad860c2f
5 changed files with 28 additions and 53 deletions

View File

@@ -552,6 +552,10 @@ type Framework interface {
// passed to the plugin factories at the time of plugin initialization. Plugins
// must store and use this handle to call framework functions.
type Handle interface {
// PodNominator abstracts operations to maintain nominated Pods.
PodNominator
// PluginsRunner abstracts operations to run some plugins.
PluginsRunner
// SnapshotSharedLister returns listers from the latest NodeInfo Snapshot. The snapshot
// is taken at the beginning of a scheduling cycle and remains unchanged until
// a pod finishes "Permit" point. There is no guarantee that the information
@@ -581,8 +585,8 @@ type Handle interface {
// RunFilterPluginsWithNominatedPods runs the set of configured filter plugins for nominated pod on the given node.
RunFilterPluginsWithNominatedPods(ctx context.Context, state *CycleState, pod *v1.Pod, info *NodeInfo) *Status
// TODO: unroll the wrapped interfaces to Handle.
PreemptHandle() PreemptHandle
// Extenders returns registered scheduler extenders.
Extenders() []Extender
}
// PostFilterResult wraps needed info for scheduler framework to act upon PostFilter phase.
@@ -590,16 +594,6 @@ type PostFilterResult struct {
NominatedNodeName string
}
// PreemptHandle incorporates all needed logic to run preemption logic.
type PreemptHandle interface {
// PodNominator abstracts operations to maintain nominated Pods.
PodNominator
// PluginsRunner abstracts operations to run some plugins.
PluginsRunner
// Extenders returns registered scheduler extenders.
Extenders() []Extender
}
// PodNominator abstracts operations to maintain nominated Pods.
type PodNominator interface {
// AddNominatedPod adds the given pod to the nominated pod map or