This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 9d7fddf9 [YUNIKORN-2602] Fix spelling/grammar in configvalidator.go 
(#869)
9d7fddf9 is described below

commit 9d7fddf9a3618ec449e7ca974461d5a3745ac49f
Author: YUN SUN <[email protected]>
AuthorDate: Thu May 16 18:05:28 2024 +0800

    [YUNIKORN-2602] Fix spelling/grammar in configvalidator.go (#869)
    
    Closes: #869
    
    Signed-off-by: Chia-Ping Tsai <[email protected]>
---
 pkg/common/configs/configvalidator.go | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/pkg/common/configs/configvalidator.go 
b/pkg/common/configs/configvalidator.go
index ec8e15a3..390b39b0 100644
--- a/pkg/common/configs/configvalidator.go
+++ b/pkg/common/configs/configvalidator.go
@@ -478,7 +478,7 @@ func checkPlacementFilter(filter Filter) error {
 }
 
 // Check a single limit entry
-func checkLimit(limit Limit, existedUserName map[string]bool, existedGroupName 
map[string]bool, queue *QueueConfig) error {
+func checkLimit(limit Limit, existingUserName map[string]bool, 
existingGroupName map[string]bool, queue *QueueConfig) error {
        if len(limit.Users) == 0 && len(limit.Groups) == 0 {
                return fmt.Errorf("empty user and group lists defined in limit 
'%v'", limit)
        }
@@ -488,15 +488,15 @@ func checkLimit(limit Limit, existedUserName 
map[string]bool, existedGroupName m
                        return fmt.Errorf("invalid limit user name '%s' in 
limit definition", name)
                }
 
-               if existedUserName[name] {
+               if existingUserName[name] {
                        return fmt.Errorf("duplicated user name '%s', already 
exists", name)
                }
-               existedUserName[name] = true
+               existingUserName[name] = true
 
                // The user without wildcard should not happen after the 
wildcard user
                // It means the wildcard for user should be the last item for 
limits object list which including the username,
                // and we should only set one wildcard user for all limits
-               if existedUserName["*"] && name != "*" {
+               if existingUserName["*"] && name != "*" {
                        return fmt.Errorf("should not set no wildcard user %s 
after wildcard user limit", name)
                }
        }
@@ -505,15 +505,15 @@ func checkLimit(limit Limit, existedUserName 
map[string]bool, existedGroupName m
                        return fmt.Errorf("invalid limit group name '%s' in 
limit definition", name)
                }
 
-               if existedGroupName[name] {
-                       return fmt.Errorf("duplicated group name '%s' , already 
existed", name)
+               if existingGroupName[name] {
+                       return fmt.Errorf("duplicated group name '%s'", name)
                }
-               existedGroupName[name] = true
+               existingGroupName[name] = true
 
                // The group without wildcard should not happen after the 
wildcard group
                // It means the wildcard for group should be the last item for 
limits object list which including the group name,
                // and we should only set one wildcard group for all limits
-               if existedGroupName["*"] && name != "*" {
+               if existingGroupName["*"] && name != "*" {
                        return fmt.Errorf("should not set no wildcard group %s 
after wildcard group limit", name)
                }
        }
@@ -522,7 +522,7 @@ func checkLimit(limit Limit, existedUserName 
map[string]bool, existedGroupName m
        // If there is no specific group mentioned the wildcard group limit 
would thus be the same as the queue limit.
        // For that reason we do not allow specifying only one group limit that 
is using the wildcard.
        // There must be at least one limit with a group name defined.
-       if existedGroupName["*"] && len(existedGroupName) == 1 {
+       if existingGroupName["*"] && len(existingGroupName) == 1 {
                return fmt.Errorf("should not specify only one group limit that 
is using the wildcard. " +
                        "There must be at least one limit with a group name 
defined ")
        }
@@ -578,11 +578,11 @@ func checkLimits(limits []Limit, obj string, queue 
*QueueConfig) error {
                zap.String("objName", obj),
                zap.Int("limitsLength", len(limits)))
 
-       existedUserName := make(map[string]bool)
-       existedGroupName := make(map[string]bool)
+       existingUserName := make(map[string]bool)
+       existingGroupName := make(map[string]bool)
 
        for _, limit := range limits {
-               if err := checkLimit(limit, existedUserName, existedGroupName, 
queue); err != nil {
+               if err := checkLimit(limit, existingUserName, 
existingGroupName, queue); err != nil {
                        return err
                }
        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to