// we have concurrent requests to update quota, so look to retry if needed
// we have concurrent requests to update quota, so look to retry if needed
ifretry==numRetries{
ifretry==numRetries{
returnadmission.NewForbidden(a,fmt.Errorf("Unable to %s %s at this time because there are too many concurrent requests to increment quota",a.GetOperation(),a.GetResource()))
returnadmission.NewForbidden(a,fmt.Errorf("unable to %s %s at this time because there are too many concurrent requests to increment quota",a.GetOperation(),a.GetResource()))
returnfalse,fmt.Errorf("Must make a non-zero request for %s since it is tracked by quota.",resourceName)
returnfalse,fmt.Errorf("must make a non-zero request for %s since it is tracked by quota.",resourceName)
}
}
// if this operation is an update, we need to find the delta usage from the previous state
// if this operation is an update, we need to find the delta usage from the previous state
...
@@ -250,12 +252,14 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
...
@@ -250,12 +252,14 @@ func IncrementUsage(a admission.Attributes, status *api.ResourceQuotaStatus, cli
}
}
ifnewUsageValue>hardUsageValue{
ifnewUsageValue>hardUsageValue{
returnfalse,fmt.Errorf("Unable to admit pod without exceeding quota for resource %s: Limited to %s but require %s to succeed.",resourceName,hard.String(),newUsage.String())
errs=append(errs,fmt.Errorf("unable to admit pod without exceeding quota for resource %s: limited to %s but require %s to succeed.",resourceName,hard.String(),newUsage.String()))