Merge pull request #82732 from ahmad-diaa/remove-unused-consts

Remove Unused Variables in scheduler api types
This commit is contained in:
Kubernetes Prow Robot 2019-09-17 09:30:24 -07:00 committed by GitHub
commit c431353ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -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

View File

@ -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,
},
{