"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "plugin/pkg/admission/resourcequota/controller.go" between
kubernetes-1.18.14.tar.gz and kubernetes-1.18.15.tar.gz

About: Kubernetes is a platform for automating deployment, scaling, and operations of application containers across clusters of hosts (written in "Go"). 1.18.x series.

controller.go  (kubernetes-1.18.14):controller.go  (kubernetes-1.18.15)
skipping to change at line 513 skipping to change at line 513
metadata, err := meta.Accessor(prevItem) metadata, err := meta.Accessor(prevItem)
if err == nil && len(metadata.GetResourceVersion()) > 0 { if err == nil && len(metadata.GetResourceVersion()) > 0 {
prevUsage, innerErr := evaluator.Usage(prevItem) prevUsage, innerErr := evaluator.Usage(prevItem)
if innerErr != nil { if innerErr != nil {
return quotas, innerErr return quotas, innerErr
} }
deltaUsage = quota.SubtractWithNonNegativeResult(deltaUsa ge, prevUsage) deltaUsage = quota.SubtractWithNonNegativeResult(deltaUsa ge, prevUsage)
} }
} }
if quota.IsZero(deltaUsage) { // ignore items in deltaUsage with zero usage
deltaUsage = quota.RemoveZeros(deltaUsage)
// if there is no remaining non-zero usage, short-circuit and return
if len(deltaUsage) == 0 {
return quotas, nil return quotas, nil
} }
// verify that for every resource that had limited by default consumption // verify that for every resource that had limited by default consumption
// enabled that there was a corresponding quota that covered its use. // enabled that there was a corresponding quota that covered its use.
// if not, we reject the request. // if not, we reject the request.
hasNoCoveringQuota := limitedResourceNamesSet.Difference(restrictedResour cesSet) hasNoCoveringQuota := limitedResourceNamesSet.Difference(restrictedResour cesSet)
if len(hasNoCoveringQuota) > 0 { if len(hasNoCoveringQuota) > 0 {
return quotas, admission.NewForbidden(a, 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(), ",")))
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)