mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
fix based on reviews
This commit is contained in:
parent
cb5dc46edf
commit
4f5bc7e8d7
@ -180,7 +180,7 @@ type Status struct {
|
||||
reasons []string
|
||||
err error
|
||||
// failedPlugin is an optional field that records the plugin name a Pod failed by.
|
||||
// It's set by the framework when code is Unschedulable or UnschedulableAndUnresolvable.
|
||||
// It's set by the framework when code is Unschedulable, UnschedulableAndUnresolvable or Pending.
|
||||
failedPlugin string
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ const (
|
||||
NoNodeAvailableMsg = "0/%v nodes are available"
|
||||
)
|
||||
|
||||
func (d *Diagnosis) SetFailedPlugin(sts *Status) {
|
||||
func (d *Diagnosis) AddPluginStatus(sts *Status) {
|
||||
if sts.FailedPlugin() == "" {
|
||||
return
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ func (p *PriorityQueue) isPodWorthRequeuing(logger klog.Logger, pInfo *framework
|
||||
continue
|
||||
}
|
||||
|
||||
h, err := hintfn.QueueingHintFn(logger, pod, oldObj, newObj)
|
||||
hint, err := hintfn.QueueingHintFn(logger, pod, oldObj, newObj)
|
||||
if err != nil {
|
||||
// If the QueueingHintFn returned an error, we should treat the event as Queue so that we can prevent
|
||||
// the Pod from being stuck in the unschedulable pod pool.
|
||||
@ -461,9 +461,9 @@ func (p *PriorityQueue) isPodWorthRequeuing(logger klog.Logger, pInfo *framework
|
||||
} else {
|
||||
logger.Error(err, "QueueingHintFn returns error", "event", event, "plugin", hintfn.PluginName, "pod", klog.KObj(pod), "oldObj", klog.KObj(oldObjMeta), "newObj", klog.KObj(newObjMeta))
|
||||
}
|
||||
h = framework.Queue
|
||||
hint = framework.Queue
|
||||
}
|
||||
if h == framework.QueueSkip {
|
||||
if hint == framework.QueueSkip {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ func (sched *Scheduler) schedulingCycle(
|
||||
NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: sts},
|
||||
},
|
||||
}
|
||||
fitErr.Diagnosis.SetFailedPlugin(sts)
|
||||
fitErr.Diagnosis.AddPluginStatus(sts)
|
||||
return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, framework.NewStatus(sts.Code()).WithError(fitErr)
|
||||
}
|
||||
return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, sts
|
||||
@ -237,7 +237,7 @@ func (sched *Scheduler) schedulingCycle(
|
||||
NodeToStatusMap: framework.NodeToStatusMap{scheduleResult.SuggestedHost: runPermitStatus},
|
||||
},
|
||||
}
|
||||
fitErr.Diagnosis.SetFailedPlugin(runPermitStatus)
|
||||
fitErr.Diagnosis.AddPluginStatus(runPermitStatus)
|
||||
return ScheduleResult{nominatingInfo: clearNominatedNode}, assumedPodInfo, framework.NewStatus(runPermitStatus.Code()).WithError(fitErr)
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ func (sched *Scheduler) findNodesThatFitPod(ctx context.Context, fwk framework.F
|
||||
msg := s.Message()
|
||||
diagnosis.PreFilterMsg = msg
|
||||
logger.V(5).Info("Status after running PreFilter plugins for pod", "pod", klog.KObj(pod), "status", msg)
|
||||
diagnosis.SetFailedPlugin(s)
|
||||
diagnosis.AddPluginStatus(s)
|
||||
return nil, diagnosis, nil
|
||||
}
|
||||
|
||||
@ -569,7 +569,7 @@ func (sched *Scheduler) findNodesThatPassFilters(
|
||||
} else {
|
||||
statusesLock.Lock()
|
||||
diagnosis.NodeToStatusMap[nodeInfo.Node().Name] = status
|
||||
diagnosis.SetFailedPlugin(status)
|
||||
diagnosis.AddPluginStatus(status)
|
||||
statusesLock.Unlock()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user