mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
Make scheduler predicates test correctly use request instead of a limit
This commit is contained in:
parent
81b6ac4755
commit
092c1b46ee
@ -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"),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user