Skip to content

Commit

Permalink
webhook: fix validateQuotaTopology for root quota (#1918)
Browse files Browse the repository at this point in the history
Signed-off-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
Co-authored-by: chuanyun.lcy <chuanyun.lcy@alibaba-inc.com>
  • Loading branch information
shaloulcy and chuanyun.lcy committed Feb 26, 2024
1 parent 5afff95 commit 658bc5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/webhook/elasticquota/quota_topology_check.go
Expand Up @@ -69,6 +69,10 @@ func (qt *quotaTopology) validateQuotaSelfItem(quota *v1alpha1.ElasticQuota) err
// validateQuotaTopology checks the quotaInfo's topology with its parent and its children.
// oldQuotaInfo is null wben validate a new create request, and is the current quotaInfo when validate a update request.
func (qt *quotaTopology) validateQuotaTopology(oldQuotaInfo, newQuotaInfo *QuotaInfo, oldNamespaces []string) error {
if newQuotaInfo.Name == extension.RootQuotaName {
return nil
}

if err := qt.checkIsParentChange(oldQuotaInfo, newQuotaInfo, oldNamespaces); err != nil {
return err
}
Expand Down

0 comments on commit 658bc5a

Please sign in to comment.