1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 21:31:18 +01:00

return pod qos in advance

This commit is contained in:
Hao Fan
2024-06-10 00:22:17 +08:00
parent 69e5c5a1ef
commit fd7fcbddfe

View File

@@ -20,6 +20,10 @@ func isSupportedQoSComputeResource(name v1.ResourceName) bool {
// A pod is guaranteed only when requests and limits are specified for all the containers and they are equal.
// A pod is burstable if limits and requests do not match across all containers.
func GetPodQOS(pod *v1.Pod) v1.PodQOSClass {
if len(pod.Status.QOSClass) != 0 {
return pod.Status.QOSClass
}
requests := v1.ResourceList{}
limits := v1.ResourceList{}
zeroQuantity := resource.MustParse("0")