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 3b5a65d0 [YUNIKORN-2259] add more meaningful error message when the 
invalid config is caused by undefined maxapplications (#761)
3b5a65d0 is described below

commit 3b5a65d085ff49319e4ce6705e91a416efea1d70
Author: Kuan-Po Tseng <[email protected]>
AuthorDate: Tue Dec 26 14:27:16 2023 +0800

    [YUNIKORN-2259] add more meaningful error message when the invalid config 
is caused by undefined maxapplications (#761)
    
    Reviewers: Peter Bacsko <[email protected]>, Chia-Ping Tsai 
<[email protected]>
---
 pkg/common/configs/configvalidator.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pkg/common/configs/configvalidator.go 
b/pkg/common/configs/configvalidator.go
index e9e28168..14e3815d 100644
--- a/pkg/common/configs/configvalidator.go
+++ b/pkg/common/configs/configvalidator.go
@@ -213,9 +213,12 @@ func checkLimitResource(cur QueueConfig, users 
map[string]map[string]*resources.
 func checkQueueMaxApplications(cur QueueConfig) error {
        var err error
        for _, child := range cur.Queues {
-               if cur.MaxApplications != 0 && (cur.MaxApplications < 
child.MaxApplications || child.MaxApplications == 0) {
+               if cur.MaxApplications != 0 && cur.MaxApplications < 
child.MaxApplications {
                        return fmt.Errorf("parent maxApplications must be 
larger than child maxApplications")
                }
+               if cur.MaxApplications != 0 && child.MaxApplications == 0 {
+                       return fmt.Errorf("maxApplications is either undefined 
or zero, which is not allowed when parent queue's maxApplications is defined")
+               }
                err = checkQueueMaxApplications(child)
                if err != nil {
                        return err


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

Reply via email to