mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 03:33:56 +00:00
Merge pull request #25190 from ingvagabund/e2e-scheduler-predicates-validate-resource-limits
Automatic merge from submit-queue SchedulerPredicates e2e test: be more verbose about requested resource When ``validates resource limits of pods that are allowed to run [Conformance]`` test is run, logs could give more information about requested resource and say it is for cpu and in mili units. cpu is stored in m units here: ``` nodeToCapacityMap[node.Name] = capacity.MilliValue() ```
This commit is contained in:
commit
27512dd0a1
@ -289,7 +289,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
|
|||||||
for _, pod := range pods.Items {
|
for _, pod := range pods.Items {
|
||||||
_, found := nodeToCapacityMap[pod.Spec.NodeName]
|
_, found := nodeToCapacityMap[pod.Spec.NodeName]
|
||||||
if found && pod.Status.Phase == api.PodRunning {
|
if found && pod.Status.Phase == api.PodRunning {
|
||||||
framework.Logf("Pod %v requesting resource %v on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName)
|
framework.Logf("Pod %v requesting resource cpu=%vm on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName)
|
||||||
nodeToCapacityMap[pod.Spec.NodeName] -= getRequestedCPU(pod)
|
nodeToCapacityMap[pod.Spec.NodeName] -= getRequestedCPU(pod)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ var _ = framework.KubeDescribe("SchedulerPredicates [Serial]", func() {
|
|||||||
var podsNeededForSaturation int
|
var podsNeededForSaturation int
|
||||||
milliCpuPerPod := int64(500)
|
milliCpuPerPod := int64(500)
|
||||||
for name, leftCapacity := range nodeToCapacityMap {
|
for name, leftCapacity := range nodeToCapacityMap {
|
||||||
framework.Logf("Node: %v has capacity: %v", name, leftCapacity)
|
framework.Logf("Node: %v has cpu capacity: %vm", name, leftCapacity)
|
||||||
podsNeededForSaturation += (int)(leftCapacity / milliCpuPerPod)
|
podsNeededForSaturation += (int)(leftCapacity / milliCpuPerPod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user