brandboat commented on code in PR #763:
URL: https://github.com/apache/yunikorn-core/pull/763#discussion_r1443042851


##########
pkg/common/configs/configvalidator.go:
##########
@@ -595,6 +596,26 @@ func checkLimits(limits []Limit, obj string, queue 
*QueueConfig) error {
        return nil
 }
 
+func checkLimitsStructure(partitionConfig *PartitionConfig) error {
+       partitionLimits := partitionConfig.Limits
+       rootQueue := partitionConfig.Queues[0]
+
+       if len(partitionConfig.Queues) < 1 || 
strings.ToLower(partitionConfig.Queues[0].Name) != RootQueue {
+               return fmt.Errorf("top queue is not root")
+       }
+
+       if len(partitionLimits) > 0 && len(rootQueue.Limits) > 0 && 
!reflect.DeepEqual(partitionLimits, rootQueue.Limits) {
+               return fmt.Errorf("partition limits and root queue limits are 
not equivalent")
+       }
+
+       // if root queue limits not defined, apply partition limits
+       if len(partitionLimits) > 0 && len(rootQueue.Limits) == 0 {
+               partitionConfig.Queues[0].Limits = partitionLimits

Review Comment:
   Actually this can't be replaced with `rootQueue`, otherwise the ~~partition 
limits~~ root queue limits won't change.



-- 
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]

Reply via email to