mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
generic_scheduler: Schedule() pod param should never be nil
This commit is contained in:
@@ -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()
|
||||||
|
Reference in New Issue
Block a user