Merge pull request #126534 from googs1025/scheduler_cleanup

scheduler: use logger instead of new klog.FromContext(ctx)
This commit is contained in:
Kubernetes Prow Robot 2024-08-13 22:10:56 -07:00 committed by GitHub
commit 5e2cead785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1080,7 +1080,6 @@ func (sched *Scheduler) handleSchedulingFailure(ctx context.Context, fwk framewo
// and the time the scheduler receives a Pod Update for the nominated pod.
// Here we check for nil only for tests.
if sched.SchedulingQueue != nil {
logger := klog.FromContext(ctx)
sched.SchedulingQueue.AddNominatedPod(logger, podInfo.PodInfo, nominatingInfo)
}
@ -1097,7 +1096,7 @@ func (sched *Scheduler) handleSchedulingFailure(ctx context.Context, fwk framewo
Reason: reason,
Message: errMsg,
}, nominatingInfo); err != nil {
klog.FromContext(ctx).Error(err, "Error updating pod", "pod", klog.KObj(pod))
logger.Error(err, "Error updating pod", "pod", klog.KObj(pod))
}
}