Refactore calculateOccupancy in pkg/scheduler

This commit is contained in:
Claire Li 2014-11-04 21:44:44 -08:00
parent 1dddcea2f0
commit 076f1638b8

View File

@ -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
}