mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Log an error when kube-scheduler fails to update the condition of the pod.
This commit is contained in:
parent
1871f75b32
commit
00afede30d
@ -272,12 +272,14 @@ func (sched *Scheduler) Config() *factory.Config {
|
||||
func (sched *Scheduler) recordSchedulingFailure(pod *v1.Pod, err error, reason string, message string) {
|
||||
sched.config.Error(pod, err)
|
||||
sched.config.Recorder.Eventf(pod, nil, v1.EventTypeWarning, "FailedScheduling", "Scheduling", message)
|
||||
sched.config.PodConditionUpdater.Update(pod, &v1.PodCondition{
|
||||
if err := sched.config.PodConditionUpdater.Update(pod, &v1.PodCondition{
|
||||
Type: v1.PodScheduled,
|
||||
Status: v1.ConditionFalse,
|
||||
Reason: reason,
|
||||
Message: err.Error(),
|
||||
})
|
||||
}); err != nil {
|
||||
klog.Errorf("Error updating the condition of the pod %s/%s: %v", pod.Namespace, pod.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
// schedule implements the scheduling algorithm and returns the suggested result(host,
|
||||
|
Loading…
Reference in New Issue
Block a user