Merge pull request #26969 from derekwaynecarr/use_qos_utility
Automatic merge from submit-queue
ResourceQuota BestEffort scope aligned with Pod level QoS
This aligns quota with the changes in kubelet and CLI.
So if quota allows 10 `BestEffort` pods, it will now track properly with what the user sees with changes in 1.3.
```
apiVersion: v1
kind: ResourceQuota
metadata:
  name: best-effort
spec:
  hard:
    pods: "10"
  scopes:
  - BestEffort
```
/cc @vishh @kubernetes/rh-cluster-infra
			
			
This commit is contained in:
		@@ -172,16 +172,7 @@ func PodMatchesScopeFunc(scope api.ResourceQuotaScope, object runtime.Object) bo
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func isBestEffort(pod *api.Pod) bool {
 | 
					func isBestEffort(pod *api.Pod) bool {
 | 
				
			||||||
	// TODO: when we have request/limits on a pod scope, we need to revisit this
 | 
						return util.GetPodQos(pod) == util.BestEffort
 | 
				
			||||||
	for _, container := range pod.Spec.Containers {
 | 
					 | 
				
			||||||
		qosPerResource := util.GetQoS(&container)
 | 
					 | 
				
			||||||
		for _, qos := range qosPerResource {
 | 
					 | 
				
			||||||
			if util.BestEffort == qos {
 | 
					 | 
				
			||||||
				return true
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return false
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func isTerminating(pod *api.Pod) bool {
 | 
					func isTerminating(pod *api.Pod) bool {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user