mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
prefilter extension point implementation.
This commit is contained in:
@@ -280,8 +280,8 @@ func (sched *Scheduler) recordSchedulingFailure(pod *v1.Pod, err error, reason s
|
||||
|
||||
// schedule implements the scheduling algorithm and returns the suggested result(host,
|
||||
// evaluated nodes number,feasible nodes number).
|
||||
func (sched *Scheduler) schedule(pod *v1.Pod) (core.ScheduleResult, error) {
|
||||
result, err := sched.config.Algorithm.Schedule(pod, sched.config.NodeLister)
|
||||
func (sched *Scheduler) schedule(pod *v1.Pod, pluginContext *framework.PluginContext) (core.ScheduleResult, error) {
|
||||
result, err := sched.config.Algorithm.Schedule(pod, sched.config.NodeLister, pluginContext)
|
||||
if err != nil {
|
||||
pod = pod.DeepCopy()
|
||||
sched.recordSchedulingFailure(pod, err, v1.PodReasonUnschedulable, err.Error())
|
||||
@@ -458,7 +458,7 @@ func (sched *Scheduler) scheduleOne() {
|
||||
// Synchronously attempt to find a fit for the pod.
|
||||
start := time.Now()
|
||||
pluginContext := framework.NewPluginContext()
|
||||
scheduleResult, err := sched.schedule(pod)
|
||||
scheduleResult, err := sched.schedule(pod, pluginContext)
|
||||
if err != nil {
|
||||
// schedule() may have failed because the pod would not fit on any host, so we try to
|
||||
// preempt, with the expectation that the next time the pod is tried for scheduling it
|
||||
|
||||
Reference in New Issue
Block a user