Commit c1828b31 authored by Wojciech Tyczynski's avatar Wojciech Tyczynski

Merge pull request #18218 from gmarek/fix-test

Make scheduler predicates test correctly use request instead of a limit
parents 1e4888f6 092c1b46
...@@ -89,7 +89,7 @@ func startPods(c *client.Client, replicas int, ns string, podNamePrefix string, ...@@ -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() { ...@@ -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"),
},
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment