not return 500 status code for insufficient quota

pull/8/head
Cao Shufeng 2018-04-09 17:49:09 +08:00
parent d39bfa0d13
commit 1ba7082176
1 changed files with 1 additions and 1 deletions

View File

@ -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 {