mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 22:20:51 +00:00
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>
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user