Merge pull request #18218 from gmarek/fix-test

Make scheduler predicates test correctly use request instead of a limit
This commit is contained in:
Wojciech Tyczynski 2015-12-09 14:29:35 +01:00
commit c1828b3153

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"),
},
}, },
}, },
}, },