Commit 9e7ed221 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #24379 from huang195/quota_fixes

Automatic merge from submit-queue minor comment and code fixes 1. Correct a comment: return value should be nil, and not true 2. Early loop break
parents 031c1ea3 b6557bab
...@@ -48,8 +48,8 @@ func MatchesNoScopeFunc(scope api.ResourceQuotaScope, object runtime.Object) boo ...@@ -48,8 +48,8 @@ func MatchesNoScopeFunc(scope api.ResourceQuotaScope, object runtime.Object) boo
return false return false
} }
// ObjectCountConstraintsFunc returns true if the specified resource name is in // ObjectCountConstraintsFunc returns ConstraintsFunc that returns nil if the
// the required set of resource names // specified resource name is in the required set of resource names
func ObjectCountConstraintsFunc(resourceName api.ResourceName) ConstraintsFunc { func ObjectCountConstraintsFunc(resourceName api.ResourceName) ConstraintsFunc {
return func(required []api.ResourceName, item runtime.Object) error { return func(required []api.ResourceName, item runtime.Object) error {
if !quota.Contains(required, resourceName) { if !quota.Contains(required, resourceName) {
...@@ -133,6 +133,7 @@ func (g *GenericEvaluator) Matches(resourceQuota *api.ResourceQuota, item runtim ...@@ -133,6 +133,7 @@ func (g *GenericEvaluator) Matches(resourceQuota *api.ResourceQuota, item runtim
for resourceName := range resourceQuota.Status.Hard { for resourceName := range resourceQuota.Status.Hard {
if g.MatchesResource(resourceName) { if g.MatchesResource(resourceName) {
matchResource = true matchResource = true
break
} }
} }
// by default, no scopes matches all // by default, no scopes matches all
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment