mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
remove unused variables in scheduler api types
This commit is contained in:
parent
24b1e7f27f
commit
b771490e88
@ -26,16 +26,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
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 defines the max total priority value.
|
||||||
MaxTotalPriority = int64(math.MaxInt64)
|
MaxTotalPriority = int64(math.MaxInt64)
|
||||||
// MaxPriority defines the max priority value.
|
// MaxPriority defines the max priority value.
|
||||||
MaxPriority = 10
|
MaxPriority = 10
|
||||||
// MaxWeight defines the max weight value.
|
// MaxWeight defines the max weight value.
|
||||||
MaxWeight = int64(math.MaxInt64 / MaxPriority)
|
MaxWeight = MaxTotalPriority / MaxPriority
|
||||||
// DefaultPercentageOfNodesToScore defines the percentage of nodes of all nodes
|
// DefaultPercentageOfNodesToScore defines the percentage of nodes of all nodes
|
||||||
// that once found feasible, the scheduler stops looking for more nodes.
|
// that once found feasible, the scheduler stops looking for more nodes.
|
||||||
DefaultPercentageOfNodesToScore = 50
|
DefaultPercentageOfNodesToScore = 50
|
||||||
|
@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package factory
|
package factory
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -59,13 +58,13 @@ func TestValidatePriorityConfigOverFlow(t *testing.T) {
|
|||||||
expected bool
|
expected bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
description: "one of the weights is MaxInt64",
|
description: "one of the weights is MaxTotalPriority(MaxInt64)",
|
||||||
configs: []priorities.PriorityConfig{{Weight: math.MaxInt64}, {Weight: 5}},
|
configs: []priorities.PriorityConfig{{Weight: api.MaxTotalPriority}, {Weight: 5}},
|
||||||
expected: true,
|
expected: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "after multiplication with MaxPriority the weight is larger than MaxWeight",
|
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,
|
expected: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user