mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #80736 from cofyc/log-error-when-api-requst-fails
Log an error when kube-scheduler fails to update the condition of the pod
This commit is contained in:
commit
fc46a2f59c
@ -272,12 +272,14 @@ func (sched *Scheduler) Config() *factory.Config {
|
|||||||
func (sched *Scheduler) recordSchedulingFailure(pod *v1.Pod, err error, reason string, message string) {
|
func (sched *Scheduler) recordSchedulingFailure(pod *v1.Pod, err error, reason string, message string) {
|
||||||
sched.config.Error(pod, err)
|
sched.config.Error(pod, err)
|
||||||
sched.config.Recorder.Eventf(pod, nil, v1.EventTypeWarning, "FailedScheduling", "Scheduling", message)
|
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,
|
Type: v1.PodScheduled,
|
||||||
Status: v1.ConditionFalse,
|
Status: v1.ConditionFalse,
|
||||||
Reason: reason,
|
Reason: reason,
|
||||||
Message: err.Error(),
|
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,
|
// schedule implements the scheduling algorithm and returns the suggested result(host,
|
||||||
|
Loading…
Reference in New Issue
Block a user