mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
change result size to numAllNodes
This commit is contained in:
parent
e6dd36759f
commit
ba525460e0
@ -603,7 +603,7 @@ func (sched *Scheduler) findNodesThatPassFilters(
|
|||||||
node string
|
node string
|
||||||
status *framework.Status
|
status *framework.Status
|
||||||
}
|
}
|
||||||
result := make([]*nodeStatus, len(feasibleNodes))
|
result := make([]*nodeStatus, numAllNodes)
|
||||||
checkNode := func(i int) {
|
checkNode := func(i int) {
|
||||||
// We check the nodes starting from where we left off in the previous scheduling cycle,
|
// We check the nodes starting from where we left off in the previous scheduling cycle,
|
||||||
// this is to make sure all nodes have the same chance of being examined across pods.
|
// this is to make sure all nodes have the same chance of being examined across pods.
|
||||||
@ -625,13 +625,6 @@ func (sched *Scheduler) findNodesThatPassFilters(
|
|||||||
result[i] = &nodeStatus{node: nodeInfo.Node().Name, status: status}
|
result[i] = &nodeStatus{node: nodeInfo.Node().Name, status: status}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, item := range result {
|
|
||||||
if item == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
diagnosis.NodeToStatusMap[item.node] = item.status
|
|
||||||
diagnosis.AddPluginStatus(item.status)
|
|
||||||
}
|
|
||||||
|
|
||||||
beginCheckNode := time.Now()
|
beginCheckNode := time.Now()
|
||||||
statusCode := framework.Success
|
statusCode := framework.Success
|
||||||
@ -646,6 +639,13 @@ func (sched *Scheduler) findNodesThatPassFilters(
|
|||||||
// are found.
|
// are found.
|
||||||
fwk.Parallelizer().Until(ctx, numAllNodes, checkNode, metrics.Filter)
|
fwk.Parallelizer().Until(ctx, numAllNodes, checkNode, metrics.Filter)
|
||||||
feasibleNodes = feasibleNodes[:feasibleNodesLen]
|
feasibleNodes = feasibleNodes[:feasibleNodesLen]
|
||||||
|
for _, item := range result {
|
||||||
|
if item == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
diagnosis.NodeToStatusMap[item.node] = item.status
|
||||||
|
diagnosis.AddPluginStatus(item.status)
|
||||||
|
}
|
||||||
if err := errCh.ReceiveError(); err != nil {
|
if err := errCh.ReceiveError(); err != nil {
|
||||||
statusCode = framework.Error
|
statusCode = framework.Error
|
||||||
return feasibleNodes, err
|
return feasibleNodes, err
|
||||||
|
Loading…
Reference in New Issue
Block a user