manirajv06 commented on code in PR #525:
URL: https://github.com/apache/yunikorn-core/pull/525#discussion_r1163789424
##########
pkg/common/configs/configvalidator.go:
##########
@@ -316,34 +321,46 @@ func checkLimit(limit Limit, currIdx int,
userWildCardIdx, groupWildCardIdx *int
if name != "*" && !UserRegExp.MatchString(name) {
return fmt.Errorf("invalid limit user name '%s' in
limit definition", name)
}
+
+ if limitValidator.existedUserName[name] {
+ return fmt.Errorf("duplicated user name %s , already
existed", name)
+ }
+ limitValidator.existedUserName[name] = true
Review Comment:
Instead of having limitValidator as struct, we can have local variables (say
users, groups etc) of type map to do this as anyways removed all other
variables in above said struct. This way, we can remove the struct altogether.
Other than this, we are good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]