FrankYang0529 commented on code in PR #760:
URL: https://github.com/apache/yunikorn-core/pull/760#discussion_r1433905907
##########
pkg/common/configs/configvalidator.go:
##########
@@ -232,54 +232,53 @@ func checkLimitMaxApplications(cur QueueConfig, users
map[string]map[string]uint
curQueuePath = queuePath + DOT + cur.Name
}
- // Carry forward (populate) the parent limit settings to the next level
if limits are not configured for the current queue
- if len(cur.Limits) == 0 {
- if _, ok := users[queuePath]; ok {
- users[curQueuePath] = users[queuePath]
- }
- if _, ok := groups[queuePath]; ok {
- groups[curQueuePath] = groups[queuePath]
- }
- } else {
- // compare user & group limit setting between the current queue
and parent queue
- for _, limit := range cur.Limits {
- limitMaxApplications := limit.MaxApplications
- for _, user := range limit.Users {
- // Is user limit setting exists?
- if userMaxApplications, ok :=
users[queuePath][user]; ok {
- if userMaxApplications != 0 &&
(userMaxApplications < limitMaxApplications || limitMaxApplications == 0) {
- return fmt.Errorf("user %s max
applications %d of queue %s is greater than immediate or ancestor parent max
applications %d", user, limitMaxApplications, cur.Name, userMaxApplications)
- }
- // Override with min resource
- if _, ok := users[curQueuePath]; !ok {
- users[curQueuePath] =
make(map[string]uint64)
- }
- users[curQueuePath][user] =
common.Min(limitMaxApplications, userMaxApplications)
- } else {
- if _, ok := users[curQueuePath]; !ok {
- users[curQueuePath] =
make(map[string]uint64)
- }
- users[curQueuePath][user] =
limitMaxApplications
+ users[curQueuePath] = make(map[string]uint64)
+ groups[curQueuePath] = make(map[string]uint64)
+
+ // Carry forward (populate) the parent limit settings to the next level
+ for u, v := range users[queuePath] {
+ users[curQueuePath][u] = v
+ }
Review Comment:
I add comment and example for `queuePath` and `curQueuePath`. Thank you!
--
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]