From 1d3616a7711e7cc058bfda8ed2c36797a8019132 Mon Sep 17 00:00:00 2001 From: LY-today <724102053@qq.com> Date: Fri, 20 Dec 2024 18:28:21 +0800 Subject: [PATCH] ci: goimports and gofmt Signed-off-by: LY-today <724102053@qq.com> --- .../node_resources_fit_plus.go | 4 +++- .../node_resources_fit_plus_test.go | 6 +++--- .../scarce_resource_avoidance.go | 4 +++- .../scarce_resource_avoidance_test.go | 16 +++++++++------- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus.go b/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus.go index 2749f3d32..d4397bf7a 100644 --- a/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus.go +++ b/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus.go @@ -3,7 +3,7 @@ package noderesourcesfitplus import ( "context" "fmt" - "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/kubernetes/pkg/api/v1/resource" @@ -11,6 +11,8 @@ import ( "k8s.io/kubernetes/pkg/scheduler/framework" plfeature "k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature" "k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources" + + "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" ) const ( diff --git a/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus_test.go b/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus_test.go index b67338093..85a16bd5f 100644 --- a/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus_test.go +++ b/pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus_test.go @@ -91,9 +91,9 @@ func TestPlugin_Score(t *testing.T) { var v1beta2args v1beta3.NodeResourcesFitPlusArgs v1beta2args.Resources = map[v1.ResourceName]v1beta3.ResourcesType{ - "nvidia.com/gpu": v1beta3.ResourcesType{Type: k8sConfig.MostAllocated, Weight: 2}, - "cpu": v1beta3.ResourcesType{Type: k8sConfig.LeastAllocated, Weight: 1}, - "memory": v1beta3.ResourcesType{Type: k8sConfig.LeastAllocated, Weight: 1}, + "nvidia.com/gpu": {Type: k8sConfig.MostAllocated, Weight: 2}, + "cpu": {Type: k8sConfig.LeastAllocated, Weight: 1}, + "memory": {Type: k8sConfig.LeastAllocated, Weight: 1}, } var nodeResourcesFitPlusArgs config.NodeResourcesFitPlusArgs diff --git a/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance.go b/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance.go index 7201e76e9..ca3670b1d 100644 --- a/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance.go +++ b/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance.go @@ -3,11 +3,13 @@ package scarceresourceavoidance import ( "context" "fmt" - "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/kubernetes/pkg/api/v1/resource" "k8s.io/kubernetes/pkg/scheduler/framework" + + "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" ) const ( diff --git a/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance_test.go b/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance_test.go index b8bccacbc..417f154fc 100644 --- a/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance_test.go +++ b/pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance_test.go @@ -2,12 +2,8 @@ package scarceresourceavoidance import ( "context" - koordinatorclientset "github.com/koordinator-sh/koordinator/pkg/client/clientset/versioned" - koordfake "github.com/koordinator-sh/koordinator/pkg/client/clientset/versioned/fake" - koordinatorinformers "github.com/koordinator-sh/koordinator/pkg/client/informers/externalversions" - "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" - "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config/v1beta3" - "github.com/koordinator-sh/koordinator/pkg/scheduler/frameworkext" + "testing" + "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" @@ -21,7 +17,13 @@ import ( "k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort" frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime" schedulertesting "k8s.io/kubernetes/pkg/scheduler/testing" - "testing" + + koordinatorclientset "github.com/koordinator-sh/koordinator/pkg/client/clientset/versioned" + koordfake "github.com/koordinator-sh/koordinator/pkg/client/clientset/versioned/fake" + koordinatorinformers "github.com/koordinator-sh/koordinator/pkg/client/informers/externalversions" + "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config" + "github.com/koordinator-sh/koordinator/pkg/scheduler/apis/config/v1beta3" + "github.com/koordinator-sh/koordinator/pkg/scheduler/frameworkext" ) var _ framework.SharedLister = &testSharedLister{}