Merge pull request #89111 from alculquicondor/fix/nominated_unschedulable

Set unschedulable Condition after setting nominated Node
This commit is contained in:
Kubernetes Prow Robot 2020-03-13 16:52:35 -07:00 committed by GitHub
commit b6f11382f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,7 +573,6 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
defer cancel()
scheduleResult, err := sched.Algorithm.Schedule(schedulingCycleCtx, prof, state, pod)
if err != nil {
sched.recordSchedulingFailure(prof, podInfo.DeepCopy(), err, v1.PodReasonUnschedulable, err.Error())
// 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
// will fit due to the preemption. It is also possible that a different pod will schedule
@ -597,6 +596,7 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
klog.Errorf("error selecting node for pod: %v", err)
metrics.PodScheduleErrors.Inc()
}
sched.recordSchedulingFailure(prof, podInfo.DeepCopy(), err, v1.PodReasonUnschedulable, err.Error())
return
}
metrics.SchedulingAlgorithmLatency.Observe(metrics.SinceInSeconds(start))