Make scheduler predicates test correctly use request instead of a limit

This commit is contained in:
gmarek 2015-12-04 18:15:23 +01:00
parent 81b6ac4755
commit 092c1b46ee

View File

@ -89,7 +89,7 @@ func startPods(c *client.Client, replicas int, ns string, podNamePrefix string,
func getRequestedCPU(pod api.Pod) int64 { func getRequestedCPU(pod api.Pod) int64 {
var result int64 var result int64
for _, container := range pod.Spec.Containers { for _, container := range pod.Spec.Containers {
result += container.Resources.Limits.Cpu().MilliValue() result += container.Resources.Requests.Cpu().MilliValue()
} }
return result return result
} }
@ -312,6 +312,9 @@ var _ = Describe("SchedulerPredicates", func() {
Limits: api.ResourceList{ Limits: api.ResourceList{
"cpu": *resource.NewMilliQuantity(milliCpuPerPod, "DecimalSI"), "cpu": *resource.NewMilliQuantity(milliCpuPerPod, "DecimalSI"),
}, },
Requests: api.ResourceList{
"cpu": *resource.NewMilliQuantity(milliCpuPerPod, "DecimalSI"),
},
}, },
}, },
}, },