mirror of https://github.com/k3s-io/k3s
Merge pull request #62275 from CaoShuFeng/resourcequota_code
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. not return 500 status code for insufficient quota This is not an unexpected error, so it should not return a 500 code, I think. @derekwaynecarr **Release note**: ```release-note NONE ```pull/8/head
commit
860403dada
|
@ -431,7 +431,7 @@ func (e *quotaEvaluator) checkRequest(quotas []api.ResourceQuota, a admission.At
|
|||
// if not, we reject the request.
|
||||
hasNoCoveringQuota := limitedResourceNamesSet.Difference(restrictedResourcesSet)
|
||||
if len(hasNoCoveringQuota) > 0 {
|
||||
return quotas, fmt.Errorf("insufficient quota to consume: %v", strings.Join(hasNoCoveringQuota.List(), ","))
|
||||
return quotas, admission.NewForbidden(a, fmt.Errorf("insufficient quota to consume: %v", strings.Join(hasNoCoveringQuota.List(), ",")))
|
||||
}
|
||||
|
||||
if len(interestingQuotaIndexes) == 0 {
|
||||
|
|
Loading…
Reference in New Issue