Scheduler NodeInfo cleanup

This commit is contained in:
Abdullah Gharaibeh
2020-04-09 16:31:34 -04:00
parent 0c9245a29f
commit 2c51c13620
27 changed files with 244 additions and 376 deletions

View File

@@ -106,14 +106,14 @@ func (rl *ResourceLimits) Score(ctx context.Context, state *framework.CycleState
if err != nil || nodeInfo.Node() == nil {
return 0, framework.NewStatus(framework.Error, fmt.Sprintf("getting node %q from Snapshot: %v, node is nil: %v", nodeName, err, nodeInfo.Node() == nil))
}
allocatableResources := nodeInfo.AllocatableResource()
podLimits, err := getPodResource(state)
if err != nil {
return 0, framework.NewStatus(framework.Error, err.Error())
}
cpuScore := computeScore(podLimits.MilliCPU, allocatableResources.MilliCPU)
memScore := computeScore(podLimits.Memory, allocatableResources.Memory)
cpuScore := computeScore(podLimits.MilliCPU, nodeInfo.Allocatable.MilliCPU)
memScore := computeScore(podLimits.Memory, nodeInfo.Allocatable.Memory)
score := int64(0)
if cpuScore == 1 || memScore == 1 {