From b771490e8845bc7dc27168b9eea355a4b55d24ce Mon Sep 17 00:00:00 2001 From: Ahmad Diaa Date: Sun, 15 Sep 2019 16:50:45 +0200 Subject: [PATCH] remove unused variables in scheduler api types --- pkg/scheduler/api/types.go | 6 +----- pkg/scheduler/factory/plugins_test.go | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/scheduler/api/types.go b/pkg/scheduler/api/types.go index 98e51512ed4..23b675ae90e 100644 --- a/pkg/scheduler/api/types.go +++ b/pkg/scheduler/api/types.go @@ -26,16 +26,12 @@ import ( ) const ( - // MaxUint defines the max unsigned int value. - MaxUint = ^uint(0) - // MaxInt defines the max signed int value. - MaxInt = int(MaxUint >> 1) // MaxTotalPriority defines the max total priority value. MaxTotalPriority = int64(math.MaxInt64) // MaxPriority defines the max priority value. MaxPriority = 10 // MaxWeight defines the max weight value. - MaxWeight = int64(math.MaxInt64 / MaxPriority) + MaxWeight = MaxTotalPriority / MaxPriority // DefaultPercentageOfNodesToScore defines the percentage of nodes of all nodes // that once found feasible, the scheduler stops looking for more nodes. DefaultPercentageOfNodesToScore = 50 diff --git a/pkg/scheduler/factory/plugins_test.go b/pkg/scheduler/factory/plugins_test.go index 4dd3812fc87..c72020eb402 100644 --- a/pkg/scheduler/factory/plugins_test.go +++ b/pkg/scheduler/factory/plugins_test.go @@ -17,7 +17,6 @@ limitations under the License. package factory import ( - "math" "testing" "github.com/stretchr/testify/assert" @@ -59,13 +58,13 @@ func TestValidatePriorityConfigOverFlow(t *testing.T) { expected bool }{ { - description: "one of the weights is MaxInt64", - configs: []priorities.PriorityConfig{{Weight: math.MaxInt64}, {Weight: 5}}, + description: "one of the weights is MaxTotalPriority(MaxInt64)", + configs: []priorities.PriorityConfig{{Weight: api.MaxTotalPriority}, {Weight: 5}}, expected: true, }, { description: "after multiplication with MaxPriority the weight is larger than MaxWeight", - configs: []priorities.PriorityConfig{{Weight: math.MaxInt64/api.MaxPriority + api.MaxPriority}, {Weight: 5}}, + configs: []priorities.PriorityConfig{{Weight: api.MaxWeight + api.MaxPriority}, {Weight: 5}}, expected: true, }, {