From 4d6af4d8d8ff97a045cf27a645b567d86722c4b2 Mon Sep 17 00:00:00 2001 From: Aldo Culquicondor Date: Fri, 13 Mar 2020 11:02:19 -0400 Subject: [PATCH] Set unschedulable Condition after setting nominated Node Signed-off-by: Aldo Culquicondor --- pkg/scheduler/scheduler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scheduler/scheduler.go b/pkg/scheduler/scheduler.go index c7a31f949ad..0cbc50d6840 100644 --- a/pkg/scheduler/scheduler.go +++ b/pkg/scheduler/scheduler.go @@ -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))