Skip to content

Commit fc46a2f

Browse files
authored
Merge pull request kubernetes#80736 from cofyc/log-error-when-api-requst-fails
Log an error when kube-scheduler fails to update the condition of the pod
2 parents a9a68c5 + 00afede commit fc46a2f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/scheduler/scheduler.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,14 @@ func (sched *Scheduler) Config() *factory.Config {
272272
func (sched *Scheduler) recordSchedulingFailure(pod *v1.Pod, err error, reason string, message string) {
273273
sched.config.Error(pod, err)
274274
sched.config.Recorder.Eventf(pod, nil, v1.EventTypeWarning, "FailedScheduling", "Scheduling", message)
275-
sched.config.PodConditionUpdater.Update(pod, &v1.PodCondition{
275+
if err := sched.config.PodConditionUpdater.Update(pod, &v1.PodCondition{
276276
Type: v1.PodScheduled,
277277
Status: v1.ConditionFalse,
278278
Reason: reason,
279279
Message: err.Error(),
280-
})
280+
}); err != nil {
281+
klog.Errorf("Error updating the condition of the pod %s/%s: %v", pod.Namespace, pod.Name, err)
282+
}
281283
}
282284

283285
// schedule implements the scheduling algorithm and returns the suggested result(host,

0 commit comments

Comments
 (0)