mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Scheduler PreBind plugins are currently allowed to return Unschedulable status, which should not according to the KEP and comments.
This commit is contained in:
@@ -433,11 +433,6 @@ func (f *framework) RunPreBindPlugins(
|
||||
for _, pl := range f.preBindPlugins {
|
||||
status := pl.PreBind(pc, pod, nodeName)
|
||||
if !status.IsSuccess() {
|
||||
if status.IsUnschedulable() {
|
||||
msg := fmt.Sprintf("rejected by %q at prebind: %v", pl.Name(), status.Message())
|
||||
klog.V(4).Infof(msg)
|
||||
return NewStatus(status.Code(), msg)
|
||||
}
|
||||
msg := fmt.Sprintf("error while running %q prebind plugin for pod %q: %v", pl.Name(), pod.Name, status.Message())
|
||||
klog.Error(msg)
|
||||
return NewStatus(Error, msg)
|
||||
|
||||
@@ -635,13 +635,8 @@ func (sched *Scheduler) scheduleOne() {
|
||||
preBindStatus := fwk.RunPreBindPlugins(pluginContext, assumedPod, scheduleResult.SuggestedHost)
|
||||
if !preBindStatus.IsSuccess() {
|
||||
var reason string
|
||||
if preBindStatus.IsUnschedulable() {
|
||||
metrics.PodScheduleFailures.Inc()
|
||||
reason = v1.PodReasonUnschedulable
|
||||
} else {
|
||||
metrics.PodScheduleErrors.Inc()
|
||||
reason = SchedulerError
|
||||
}
|
||||
metrics.PodScheduleErrors.Inc()
|
||||
reason = SchedulerError
|
||||
if forgetErr := sched.Cache().ForgetPod(assumedPod); forgetErr != nil {
|
||||
klog.Errorf("scheduler cache ForgetPod failed: %v", forgetErr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user