brandboat commented on code in PR #763:
URL: https://github.com/apache/yunikorn-core/pull/763#discussion_r1439056323
##########
pkg/common/configs/configvalidator.go:
##########
@@ -595,6 +595,28 @@ 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 {
+ return fmt.Errorf("partition limits and root queue limits both
exist")
+ }
+
+ // if root queue limits not defined, apply partition limits
+ if len(partitionLimits) > 0 && len(rootQueue.Limits) == 0 {
+ partitionConfig.Queues[0].Limits = partitionLimits
+ // clear partition limits
+ partitionConfig.Limits = nil
Review Comment:
> Instead, we allow both limits if they are identical.
Sounds good, I'll adopt your approach. Many thanks !
--
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]