fix: include init containers when determining pod QoS that keep consistent with kubelet
Signed-off-by: thomassong <thomassong2012@gmail.com> Co-authored-by: Paco Xu <paco.xu@daocloud.io> Kubernetes-commit: 285e43d208a29acc9d19c47099699fe13d012f8a
This commit is contained in:
parent
0a152f103a
commit
6847974534
|
@ -37,7 +37,10 @@ func GetPodQOS(pod *corev1.Pod) corev1.PodQOSClass {
|
|||
limits := corev1.ResourceList{}
|
||||
zeroQuantity := resource.MustParse("0")
|
||||
isGuaranteed := true
|
||||
for _, container := range pod.Spec.Containers {
|
||||
allContainers := []corev1.Container{}
|
||||
allContainers = append(allContainers, pod.Spec.Containers...)
|
||||
allContainers = append(allContainers, pod.Spec.InitContainers...)
|
||||
for _, container := range allContainers {
|
||||
// process requests
|
||||
for name, quantity := range container.Resources.Requests {
|
||||
if !isSupportedQoSComputeResource(name) {
|
||||
|
|
Loading…
Reference in New Issue