Skip to content

Commit 6382595

Browse files
author
draveness
committed
feat: move klog from AddUnschedulableIfNotPresent into the call site
1 parent 43ce2f1 commit 6382595

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pkg/scheduler/factory/factory.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,9 @@ func MakeDefaultErrorFunc(client clientset.Interface, podQueue internalqueue.Sch
682682
pod, err := client.CoreV1().Pods(podID.Namespace).Get(podID.Name, metav1.GetOptions{})
683683
if err == nil {
684684
if len(pod.Spec.NodeName) == 0 {
685-
podQueue.AddUnschedulableIfNotPresent(pod, podSchedulingCycle)
685+
if err := podQueue.AddUnschedulableIfNotPresent(pod, podSchedulingCycle); err != nil {
686+
klog.Error(err)
687+
}
686688
}
687689
break
688690
}

pkg/scheduler/internal/queue/scheduling_queue.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,7 @@ func (p *PriorityQueue) AddUnschedulableIfNotPresent(pod *v1.Pod, podSchedulingC
313313
// it to unschedulableQ.
314314
if p.moveRequestCycle >= podSchedulingCycle {
315315
if err := p.podBackoffQ.Add(pInfo); err != nil {
316-
// TODO: Delete this klog call and log returned errors at the call site.
317-
err = fmt.Errorf("error adding pod %v to the backoff queue: %v", pod.Name, err)
318-
klog.Error(err)
319-
return err
316+
return fmt.Errorf("error adding pod %v to the backoff queue: %v", pod.Name, err)
320317
}
321318
} else {
322319
p.unschedulableQ.addOrUpdate(pInfo)

0 commit comments

Comments
 (0)