mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Refactore calculateOccupancy in pkg/scheduler
This commit is contained in:
parent
1dddcea2f0
commit
076f1638b8
@ -34,9 +34,8 @@ func calculatePercentage(requested, capacity int) int {
|
||||
func calculateOccupancy(node api.Minion, pods []api.Pod) HostPriority {
|
||||
totalCPU := 0
|
||||
totalMemory := 0
|
||||
for ix := range pods {
|
||||
for cIx := range pods[ix].DesiredState.Manifest.Containers {
|
||||
container := &(pods[ix].DesiredState.Manifest.Containers[cIx])
|
||||
for _, pod := range pods {
|
||||
for _, container := range pod.DesiredState.Manifest.Containers {
|
||||
totalCPU += container.CPU
|
||||
totalMemory += container.Memory
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user