From 99aa90fd1262ca511a2520bd732b59b38a251db2 Mon Sep 17 00:00:00 2001 From: Wilfred Spiegelenburg Date: Thu, 14 Nov 2024 11:27:31 +1100 Subject: [PATCH] [YUNIKORN-2972] Remove Resource object from user group REST API e2e fixes for the removal of the Resource object from the REST API --- go.mod | 2 +- go.sum | 4 +-- .../user_group_limit/user_group_limit_test.go | 30 +++++++------------ 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 1da17922b..809a45d8e 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ go 1.22.0 toolchain go1.22.5 require ( - github.com/apache/yunikorn-core v0.0.0-20241104184802-6ef347b31c1c + github.com/apache/yunikorn-core v0.0.0-20241113200923-d7d1408c6395 github.com/apache/yunikorn-scheduler-interface v0.0.0-20241016105739-f0e241aa0146 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index 4674b3ff1..07b32eba7 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,8 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= -github.com/apache/yunikorn-core v0.0.0-20241104184802-6ef347b31c1c h1:c0+cVnKSAOiJHC6lNUKEl+tt7lZLIEfqv0cPaTI//4U= -github.com/apache/yunikorn-core v0.0.0-20241104184802-6ef347b31c1c/go.mod h1:JA8Uee+D+T9v3p+YznGiGM9cLk5tzX+EM+YYr1TdFYo= +github.com/apache/yunikorn-core v0.0.0-20241113200923-d7d1408c6395 h1:p7DsjbDN4j/aM0b2ZZHOqIILS+2uTwfv1Uv6na2kiQM= +github.com/apache/yunikorn-core v0.0.0-20241113200923-d7d1408c6395/go.mod h1:JA8Uee+D+T9v3p+YznGiGM9cLk5tzX+EM+YYr1TdFYo= github.com/apache/yunikorn-scheduler-interface v0.0.0-20241016105739-f0e241aa0146 h1:CZ4U7y19YSxNJVBNox3DahhuoxDL++naBl/kj+kqVFc= github.com/apache/yunikorn-scheduler-interface v0.0.0-20241016105739-f0e241aa0146/go.mod h1:co3uU98sj1CUTPNTM13lTyi+CY0DOgDndDW2KiUjktU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= diff --git a/test/e2e/user_group_limit/user_group_limit_test.go b/test/e2e/user_group_limit/user_group_limit_test.go index 45ba70c13..2a877aed6 100644 --- a/test/e2e/user_group_limit/user_group_limit_test.go +++ b/test/e2e/user_group_limit/user_group_limit_test.go @@ -29,35 +29,27 @@ import ( "strings" "time" + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" + v1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" + "github.com/apache/yunikorn-core/pkg/common/configs" - "github.com/apache/yunikorn-core/pkg/common/resources" "github.com/apache/yunikorn-core/pkg/webservice/dao" - amCommon "github.com/apache/yunikorn-k8shim/pkg/admission/common" amconf "github.com/apache/yunikorn-k8shim/pkg/admission/conf" "github.com/apache/yunikorn-k8shim/pkg/common/constants" - tests "github.com/apache/yunikorn-k8shim/test/e2e" - "github.com/apache/yunikorn-k8shim/test/e2e/framework/configmanager" "github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/common" "github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/k8s" "github.com/apache/yunikorn-k8shim/test/e2e/framework/helpers/yunikorn" - siCommon "github.com/apache/yunikorn-scheduler-interface/lib/go/common" "github.com/apache/yunikorn-scheduler-interface/lib/go/si" - - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" - - "github.com/onsi/ginkgo/v2" - "github.com/onsi/gomega" - - v1 "k8s.io/api/core/v1" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "k8s.io/client-go/kubernetes" ) type TestType int @@ -1186,7 +1178,7 @@ func checkUsage(testType TestType, name string, queuePath string, expectedRunnin appIDs = append(appIDs, pod.Labels[constants.LabelApplicationID]) } Ω(resourceUsageDAO.ResourceUsage).NotTo(gomega.BeNil()) - Ω(resourceUsageDAO.ResourceUsage.Resources["pods"]).To(gomega.Equal(resources.Quantity(len(expectedRunningPods)))) + Ω(resourceUsageDAO.ResourceUsage["pods"]).To(gomega.Equal(int64(len(expectedRunningPods)))) Ω(resourceUsageDAO.RunningApplications).To(gomega.ConsistOf(appIDs...)) } @@ -1218,6 +1210,6 @@ func checkUsageWildcardGroups(testType TestType, name string, queuePath string, appIDs = append(appIDs, pod.Labels[constants.LabelApplicationID]) } Ω(resourceUsageDAO.ResourceUsage).NotTo(gomega.BeNil()) - Ω(resourceUsageDAO.ResourceUsage.Resources["pods"]).To(gomega.Equal(resources.Quantity(len(expectedRunningPods)))) + Ω(resourceUsageDAO.ResourceUsage["pods"]).To(gomega.Equal(int64(len(expectedRunningPods)))) Ω(resourceUsageDAO.RunningApplications).To(gomega.ConsistOf(appIDs...)) }