mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
generic_scheduler: Schedule() pod param should never be nil
This commit is contained in:
parent
e092d3f47b
commit
a2426bd48a
@ -90,12 +90,7 @@ type genericScheduler struct {
|
|||||||
// If it succeeds, it will return the name of the node.
|
// If it succeeds, it will return the name of the node.
|
||||||
// If it fails, it will return a Fiterror error with reasons.
|
// If it fails, it will return a Fiterror error with reasons.
|
||||||
func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister) (string, error) {
|
func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister) (string, error) {
|
||||||
var trace *util.Trace
|
trace := util.NewTrace(fmt.Sprintf("Scheduling %s/%s", pod.Namespace, pod.Name))
|
||||||
if pod != nil {
|
|
||||||
trace = util.NewTrace(fmt.Sprintf("Scheduling %s/%s", pod.Namespace, pod.Name))
|
|
||||||
} else {
|
|
||||||
trace = util.NewTrace("Scheduling <nil> pod")
|
|
||||||
}
|
|
||||||
defer trace.LogIfLong(100 * time.Millisecond)
|
defer trace.LogIfLong(100 * time.Millisecond)
|
||||||
|
|
||||||
nodes, err := nodeLister.List()
|
nodes, err := nodeLister.List()
|
||||||
|
Loading…
Reference in New Issue
Block a user