kubelet: include init containers when determining pod QoS

This commit is contained in:
Seth Jennings
2019-05-17 09:58:56 -05:00
parent 46a80259f6
commit bcfa60d955
3 changed files with 32 additions and 4 deletions

View File

@@ -39,7 +39,10 @@ func GetPodQOS(pod *core.Pod) core.PodQOSClass {
limits := core.ResourceList{}
zeroQuantity := resource.MustParse("0")
isGuaranteed := true
for _, container := range pod.Spec.Containers {
allContainers := []core.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) {