Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
14b2014c
Unverified
Commit
14b2014c
authored
Jan 15, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jan 15, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72079 from sonasingh46/cleanup
refactor(scheduler): Move priority types to priorities package
parents
1d896079
1fe7ce21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
159 additions
and
145 deletions
+159
-145
BUILD
pkg/scheduler/BUILD
+1
-0
BUILD
pkg/scheduler/algorithm/BUILD
+1
-16
BUILD
pkg/scheduler/algorithm/priorities/BUILD
+4
-0
interpod_affinity.go
pkg/scheduler/algorithm/priorities/interpod_affinity.go
+1
-1
metadata.go
pkg/scheduler/algorithm/priorities/metadata.go
+1
-1
node_label.go
pkg/scheduler/algorithm/priorities/node_label.go
+1
-2
reduce.go
pkg/scheduler/algorithm/priorities/reduce.go
+1
-2
selector_spreading.go
pkg/scheduler/algorithm/priorities/selector_spreading.go
+2
-2
test_util.go
pkg/scheduler/algorithm/priorities/test_util.go
+1
-2
types.go
pkg/scheduler/algorithm/priorities/types.go
+59
-0
types_test.go
pkg/scheduler/algorithm/priorities/types_test.go
+5
-4
types.go
pkg/scheduler/algorithm/types.go
+0
-37
register_priorities.go
...heduler/algorithmprovider/defaults/register_priorities.go
+4
-4
BUILD
pkg/scheduler/core/BUILD
+1
-0
extender_test.go
pkg/scheduler/core/extender_test.go
+12
-11
generic_scheduler.go
pkg/scheduler/core/generic_scheduler.go
+8
-7
generic_scheduler_test.go
pkg/scheduler/core/generic_scheduler_test.go
+26
-26
factory.go
pkg/scheduler/factory/factory.go
+3
-2
plugins.go
pkg/scheduler/factory/plugins.go
+18
-18
plugins_test.go
pkg/scheduler/factory/plugins_test.go
+4
-5
scheduler_test.go
pkg/scheduler/scheduler_test.go
+6
-5
No files found.
pkg/scheduler/BUILD
View file @
14b2014c
...
@@ -46,6 +46,7 @@ go_test(
...
@@ -46,6 +46,7 @@ go_test(
"//pkg/controller/volume/persistentvolume:go_default_library",
"//pkg/controller/volume/persistentvolume:go_default_library",
"//pkg/scheduler/algorithm:go_default_library",
"//pkg/scheduler/algorithm:go_default_library",
"//pkg/scheduler/algorithm/predicates:go_default_library",
"//pkg/scheduler/algorithm/predicates:go_default_library",
"//pkg/scheduler/algorithm/priorities:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/apis/config:go_default_library",
"//pkg/scheduler/core:go_default_library",
"//pkg/scheduler/core:go_default_library",
...
...
pkg/scheduler/algorithm/BUILD
View file @
14b2014c
package(default_visibility = ["//visibility:public"])
package(default_visibility = ["//visibility:public"])
load(
load("@io_bazel_rules_go//go:def.bzl", "go_library")
"@io_bazel_rules_go//go:def.bzl",
"go_library",
"go_test",
)
go_library(
go_library(
name = "go_default_library",
name = "go_default_library",
...
@@ -24,17 +20,6 @@ go_library(
...
@@ -24,17 +20,6 @@ go_library(
],
],
)
)
go_test(
name = "go_default_test",
srcs = ["types_test.go"],
embed = [":go_default_library"],
deps = [
"//pkg/scheduler/nodeinfo:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
],
)
filegroup(
filegroup(
name = "package-srcs",
name = "package-srcs",
srcs = glob(["**"]),
srcs = glob(["**"]),
...
...
pkg/scheduler/algorithm/priorities/BUILD
View file @
14b2014c
...
@@ -26,6 +26,7 @@ go_library(
...
@@ -26,6 +26,7 @@ go_library(
"selector_spreading.go",
"selector_spreading.go",
"taint_toleration.go",
"taint_toleration.go",
"test_util.go",
"test_util.go",
"types.go",
],
],
importpath = "k8s.io/kubernetes/pkg/scheduler/algorithm/priorities",
importpath = "k8s.io/kubernetes/pkg/scheduler/algorithm/priorities",
deps = [
deps = [
...
@@ -65,11 +66,13 @@ go_test(
...
@@ -65,11 +66,13 @@ go_test(
"resource_limits_test.go",
"resource_limits_test.go",
"selector_spreading_test.go",
"selector_spreading_test.go",
"taint_toleration_test.go",
"taint_toleration_test.go",
"types_test.go",
],
],
embed = [":go_default_library"],
embed = [":go_default_library"],
deps = [
deps = [
"//pkg/features:go_default_library",
"//pkg/features:go_default_library",
"//pkg/kubelet/apis:go_default_library",
"//pkg/kubelet/apis:go_default_library",
"//pkg/scheduler/algorithm:go_default_library",
"//pkg/scheduler/algorithm/priorities/util:go_default_library",
"//pkg/scheduler/algorithm/priorities/util:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/nodeinfo:go_default_library",
"//pkg/scheduler/nodeinfo:go_default_library",
...
@@ -79,6 +82,7 @@ go_test(
...
@@ -79,6 +82,7 @@ go_test(
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature/testing:go_default_library",
"//staging/src/k8s.io/apiserver/pkg/util/feature/testing:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
...
...
pkg/scheduler/algorithm/priorities/interpod_affinity.go
View file @
14b2014c
...
@@ -46,7 +46,7 @@ func NewInterPodAffinityPriority(
...
@@ -46,7 +46,7 @@ func NewInterPodAffinityPriority(
info
predicates
.
NodeInfo
,
info
predicates
.
NodeInfo
,
nodeLister
algorithm
.
NodeLister
,
nodeLister
algorithm
.
NodeLister
,
podLister
algorithm
.
PodLister
,
podLister
algorithm
.
PodLister
,
hardPodAffinityWeight
int32
)
algorithm
.
PriorityFunction
{
hardPodAffinityWeight
int32
)
PriorityFunction
{
interPodAffinity
:=
&
InterPodAffinity
{
interPodAffinity
:=
&
InterPodAffinity
{
info
:
info
,
info
:
info
,
nodeLister
:
nodeLister
,
nodeLister
:
nodeLister
,
...
...
pkg/scheduler/algorithm/priorities/metadata.go
View file @
14b2014c
...
@@ -33,7 +33,7 @@ type PriorityMetadataFactory struct {
...
@@ -33,7 +33,7 @@ type PriorityMetadataFactory struct {
}
}
// NewPriorityMetadataFactory creates a PriorityMetadataFactory.
// NewPriorityMetadataFactory creates a PriorityMetadataFactory.
func
NewPriorityMetadataFactory
(
serviceLister
algorithm
.
ServiceLister
,
controllerLister
algorithm
.
ControllerLister
,
replicaSetLister
algorithm
.
ReplicaSetLister
,
statefulSetLister
algorithm
.
StatefulSetLister
)
algorithm
.
PriorityMetadataProducer
{
func
NewPriorityMetadataFactory
(
serviceLister
algorithm
.
ServiceLister
,
controllerLister
algorithm
.
ControllerLister
,
replicaSetLister
algorithm
.
ReplicaSetLister
,
statefulSetLister
algorithm
.
StatefulSetLister
)
PriorityMetadataProducer
{
factory
:=
&
PriorityMetadataFactory
{
factory
:=
&
PriorityMetadataFactory
{
serviceLister
:
serviceLister
,
serviceLister
:
serviceLister
,
controllerLister
:
controllerLister
,
controllerLister
:
controllerLister
,
...
...
pkg/scheduler/algorithm/priorities/node_label.go
View file @
14b2014c
...
@@ -21,7 +21,6 @@ import (
...
@@ -21,7 +21,6 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
)
...
@@ -33,7 +32,7 @@ type NodeLabelPrioritizer struct {
...
@@ -33,7 +32,7 @@ type NodeLabelPrioritizer struct {
}
}
// NewNodeLabelPriority creates a NodeLabelPrioritizer.
// NewNodeLabelPriority creates a NodeLabelPrioritizer.
func
NewNodeLabelPriority
(
label
string
,
presence
bool
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
func
NewNodeLabelPriority
(
label
string
,
presence
bool
)
(
PriorityMapFunction
,
PriorityReduceFunction
)
{
labelPrioritizer
:=
&
NodeLabelPrioritizer
{
labelPrioritizer
:=
&
NodeLabelPrioritizer
{
label
:
label
,
label
:
label
,
presence
:
presence
,
presence
:
presence
,
...
...
pkg/scheduler/algorithm/priorities/reduce.go
View file @
14b2014c
...
@@ -18,7 +18,6 @@ package priorities
...
@@ -18,7 +18,6 @@ package priorities
import
(
import
(
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
)
...
@@ -26,7 +25,7 @@ import (
...
@@ -26,7 +25,7 @@ import (
// NormalizeReduce generates a PriorityReduceFunction that can normalize the result
// NormalizeReduce generates a PriorityReduceFunction that can normalize the result
// scores to [0, maxPriority]. If reverse is set to true, it reverses the scores by
// scores to [0, maxPriority]. If reverse is set to true, it reverses the scores by
// subtracting it from maxPriority.
// subtracting it from maxPriority.
func
NormalizeReduce
(
maxPriority
int
,
reverse
bool
)
algorithm
.
PriorityReduceFunction
{
func
NormalizeReduce
(
maxPriority
int
,
reverse
bool
)
PriorityReduceFunction
{
return
func
(
return
func
(
_
*
v1
.
Pod
,
_
*
v1
.
Pod
,
_
interface
{},
_
interface
{},
...
...
pkg/scheduler/algorithm/priorities/selector_spreading.go
View file @
14b2014c
...
@@ -46,7 +46,7 @@ func NewSelectorSpreadPriority(
...
@@ -46,7 +46,7 @@ func NewSelectorSpreadPriority(
serviceLister
algorithm
.
ServiceLister
,
serviceLister
algorithm
.
ServiceLister
,
controllerLister
algorithm
.
ControllerLister
,
controllerLister
algorithm
.
ControllerLister
,
replicaSetLister
algorithm
.
ReplicaSetLister
,
replicaSetLister
algorithm
.
ReplicaSetLister
,
statefulSetLister
algorithm
.
StatefulSetLister
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
statefulSetLister
algorithm
.
StatefulSetLister
)
(
PriorityMapFunction
,
PriorityReduceFunction
)
{
selectorSpread
:=
&
SelectorSpread
{
selectorSpread
:=
&
SelectorSpread
{
serviceLister
:
serviceLister
,
serviceLister
:
serviceLister
,
controllerLister
:
controllerLister
,
controllerLister
:
controllerLister
,
...
@@ -159,7 +159,7 @@ type ServiceAntiAffinity struct {
...
@@ -159,7 +159,7 @@ type ServiceAntiAffinity struct {
}
}
// NewServiceAntiAffinityPriority creates a ServiceAntiAffinity.
// NewServiceAntiAffinityPriority creates a ServiceAntiAffinity.
func
NewServiceAntiAffinityPriority
(
podLister
algorithm
.
PodLister
,
serviceLister
algorithm
.
ServiceLister
,
label
string
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
func
NewServiceAntiAffinityPriority
(
podLister
algorithm
.
PodLister
,
serviceLister
algorithm
.
ServiceLister
,
label
string
)
(
PriorityMapFunction
,
PriorityReduceFunction
)
{
antiAffinity
:=
&
ServiceAntiAffinity
{
antiAffinity
:=
&
ServiceAntiAffinity
{
podLister
:
podLister
,
podLister
:
podLister
,
serviceLister
:
serviceLister
,
serviceLister
:
serviceLister
,
...
...
pkg/scheduler/algorithm/priorities/test_util.go
View file @
14b2014c
...
@@ -20,7 +20,6 @@ import (
...
@@ -20,7 +20,6 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
)
...
@@ -41,7 +40,7 @@ func makeNode(node string, milliCPU, memory int64) *v1.Node {
...
@@ -41,7 +40,7 @@ func makeNode(node string, milliCPU, memory int64) *v1.Node {
}
}
}
}
func
priorityFunction
(
mapFn
algorithm
.
PriorityMapFunction
,
reduceFn
algorithm
.
PriorityReduceFunction
,
metaData
interface
{})
algorithm
.
PriorityFunction
{
func
priorityFunction
(
mapFn
PriorityMapFunction
,
reduceFn
PriorityReduceFunction
,
metaData
interface
{})
PriorityFunction
{
return
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
nodes
[]
*
v1
.
Node
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
return
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
nodes
[]
*
v1
.
Node
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
result
:=
make
(
schedulerapi
.
HostPriorityList
,
0
,
len
(
nodes
))
result
:=
make
(
schedulerapi
.
HostPriorityList
,
0
,
len
(
nodes
))
for
i
:=
range
nodes
{
for
i
:=
range
nodes
{
...
...
pkg/scheduler/algorithm/priorities/types.go
0 → 100644
View file @
14b2014c
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
priorities
import
(
"k8s.io/api/core/v1"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
// PriorityMapFunction is a function that computes per-node results for a given node.
// TODO: Figure out the exact API of this method.
// TODO: Change interface{} to a specific type.
type
PriorityMapFunction
func
(
pod
*
v1
.
Pod
,
meta
interface
{},
nodeInfo
*
schedulernodeinfo
.
NodeInfo
)
(
schedulerapi
.
HostPriority
,
error
)
// PriorityReduceFunction is a function that aggregated per-node results and computes
// final scores for all nodes.
// TODO: Figure out the exact API of this method.
// TODO: Change interface{} to a specific type.
type
PriorityReduceFunction
func
(
pod
*
v1
.
Pod
,
meta
interface
{},
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
result
schedulerapi
.
HostPriorityList
)
error
// PriorityMetadataProducer is a function that computes metadata for a given pod. This
// is now used for only for priority functions. For predicates please use PredicateMetadataProducer.
type
PriorityMetadataProducer
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
)
interface
{}
// PriorityFunction is a function that computes scores for all nodes.
// DEPRECATED
// Use Map-Reduce pattern for priority functions.
type
PriorityFunction
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
nodes
[]
*
v1
.
Node
)
(
schedulerapi
.
HostPriorityList
,
error
)
// PriorityConfig is a config used for a priority function.
type
PriorityConfig
struct
{
Name
string
Map
PriorityMapFunction
Reduce
PriorityReduceFunction
// TODO: Remove it after migrating all functions to
// Map-Reduce pattern.
Function
PriorityFunction
Weight
int
}
// EmptyPriorityMetadataProducer returns a no-op PriorityMetadataProducer type.
func
EmptyPriorityMetadataProducer
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
)
interface
{}
{
return
nil
}
pkg/scheduler/algorithm/types_test.go
→
pkg/scheduler/algorithm/
priorities/
types_test.go
View file @
14b2014c
...
@@ -14,13 +14,14 @@ See the License for the specific language governing permissions and
...
@@ -14,13 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
algorithm
package
priorities
import
(
import
(
"testing"
"testing"
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
)
...
@@ -39,7 +40,7 @@ func TestEmptyPriorityMetadataProducer(t *testing.T) {
...
@@ -39,7 +40,7 @@ func TestEmptyPriorityMetadataProducer(t *testing.T) {
t
.
Errorf
(
"failed to produce empty metadata: got %v, expected nil"
,
metadata
)
t
.
Errorf
(
"failed to produce empty metadata: got %v, expected nil"
,
metadata
)
}
}
// Test EmptyControllerLister should return nill
// Test EmptyControllerLister should return nill
controllerLister
:=
EmptyControllerLister
{}
controllerLister
:=
algorithm
.
EmptyControllerLister
{}
nilController
,
nilError
:=
controllerLister
.
List
(
fakeLabelSelector
)
nilController
,
nilError
:=
controllerLister
.
List
(
fakeLabelSelector
)
if
nilController
!=
nil
||
nilError
!=
nil
{
if
nilController
!=
nil
||
nilError
!=
nil
{
t
.
Errorf
(
"failed to produce empty controller lister: got %v, expected nil"
,
nilController
)
t
.
Errorf
(
"failed to produce empty controller lister: got %v, expected nil"
,
nilController
)
...
@@ -50,14 +51,14 @@ func TestEmptyPriorityMetadataProducer(t *testing.T) {
...
@@ -50,14 +51,14 @@ func TestEmptyPriorityMetadataProducer(t *testing.T) {
t
.
Errorf
(
"failed to produce empty controller lister: got %v, expected nil"
,
nilController
)
t
.
Errorf
(
"failed to produce empty controller lister: got %v, expected nil"
,
nilController
)
}
}
// Test GetPodReplicaSets on empty replica sets should return nill
// Test GetPodReplicaSets on empty replica sets should return nill
replicaSetLister
:=
EmptyReplicaSetLister
{}
replicaSetLister
:=
algorithm
.
EmptyReplicaSetLister
{}
nilRss
,
nilErrRss
:=
replicaSetLister
.
GetPodReplicaSets
(
fakePod
)
nilRss
,
nilErrRss
:=
replicaSetLister
.
GetPodReplicaSets
(
fakePod
)
if
nilRss
!=
nil
||
nilErrRss
!=
nil
{
if
nilRss
!=
nil
||
nilErrRss
!=
nil
{
t
.
Errorf
(
"failed to produce empty replicaSetLister: got %v, expected nil"
,
nilRss
)
t
.
Errorf
(
"failed to produce empty replicaSetLister: got %v, expected nil"
,
nilRss
)
}
}
// Test GetPodStatefulSets on empty replica sets should return nill
// Test GetPodStatefulSets on empty replica sets should return nill
statefulSetLister
:=
EmptyStatefulSetLister
{}
statefulSetLister
:=
algorithm
.
EmptyStatefulSetLister
{}
nilSSL
,
nilErrSSL
:=
statefulSetLister
.
GetPodStatefulSets
(
fakePod
)
nilSSL
,
nilErrSSL
:=
statefulSetLister
.
GetPodStatefulSets
(
fakePod
)
if
nilSSL
!=
nil
||
nilErrSSL
!=
nil
{
if
nilSSL
!=
nil
||
nilErrSSL
!=
nil
{
t
.
Errorf
(
"failed to produce empty statefulSetLister: got %v, expected nil"
,
nilSSL
)
t
.
Errorf
(
"failed to produce empty statefulSetLister: got %v, expected nil"
,
nilSSL
)
...
...
pkg/scheduler/algorithm/types.go
View file @
14b2014c
...
@@ -22,7 +22,6 @@ import (
...
@@ -22,7 +22,6 @@ import (
policyv1beta1
"k8s.io/api/policy/v1beta1"
policyv1beta1
"k8s.io/api/policy/v1beta1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/labels"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulernodeinfo
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
)
)
// NodeFieldSelectorKeys is a map that: the key are node field selector keys; the values are
// NodeFieldSelectorKeys is a map that: the key are node field selector keys; the values are
...
@@ -31,42 +30,6 @@ var NodeFieldSelectorKeys = map[string]func(*v1.Node) string{
...
@@ -31,42 +30,6 @@ var NodeFieldSelectorKeys = map[string]func(*v1.Node) string{
schedulerapi
.
NodeFieldSelectorKeyNodeName
:
func
(
n
*
v1
.
Node
)
string
{
return
n
.
Name
},
schedulerapi
.
NodeFieldSelectorKeyNodeName
:
func
(
n
*
v1
.
Node
)
string
{
return
n
.
Name
},
}
}
// PriorityMapFunction is a function that computes per-node results for a given node.
// TODO: Figure out the exact API of this method.
// TODO: Change interface{} to a specific type.
type
PriorityMapFunction
func
(
pod
*
v1
.
Pod
,
meta
interface
{},
nodeInfo
*
schedulernodeinfo
.
NodeInfo
)
(
schedulerapi
.
HostPriority
,
error
)
// PriorityReduceFunction is a function that aggregated per-node results and computes
// final scores for all nodes.
// TODO: Figure out the exact API of this method.
// TODO: Change interface{} to a specific type.
type
PriorityReduceFunction
func
(
pod
*
v1
.
Pod
,
meta
interface
{},
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
result
schedulerapi
.
HostPriorityList
)
error
// PriorityMetadataProducer is a function that computes metadata for a given pod. This
// is now used for only for priority functions. For predicates please use PredicateMetadataProducer.
type
PriorityMetadataProducer
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
)
interface
{}
// PriorityFunction is a function that computes scores for all nodes.
// DEPRECATED
// Use Map-Reduce pattern for priority functions.
type
PriorityFunction
func
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
nodes
[]
*
v1
.
Node
)
(
schedulerapi
.
HostPriorityList
,
error
)
// PriorityConfig is a config used for a priority function.
type
PriorityConfig
struct
{
Name
string
Map
PriorityMapFunction
Reduce
PriorityReduceFunction
// TODO: Remove it after migrating all functions to
// Map-Reduce pattern.
Function
PriorityFunction
Weight
int
}
// EmptyPriorityMetadataProducer returns a no-op PriorityMetadataProducer type.
func
EmptyPriorityMetadataProducer
(
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
)
interface
{}
{
return
nil
}
// NodeLister interface represents anything that can list nodes for a scheduler.
// NodeLister interface represents anything that can list nodes for a scheduler.
type
NodeLister
interface
{
type
NodeLister
interface
{
// We explicitly return []*v1.Node, instead of v1.NodeList, to avoid
// We explicitly return []*v1.Node, instead of v1.NodeList, to avoid
...
...
pkg/scheduler/algorithmprovider/defaults/register_priorities.go
View file @
14b2014c
...
@@ -26,7 +26,7 @@ import (
...
@@ -26,7 +26,7 @@ import (
func
init
()
{
func
init
()
{
// Register functions that extract metadata used by priorities computations.
// Register functions that extract metadata used by priorities computations.
factory
.
RegisterPriorityMetadataProducerFactory
(
factory
.
RegisterPriorityMetadataProducerFactory
(
func
(
args
factory
.
PluginFactoryArgs
)
algorithm
.
PriorityMetadataProducer
{
func
(
args
factory
.
PluginFactoryArgs
)
priorities
.
PriorityMetadataProducer
{
return
priorities
.
NewPriorityMetadataFactory
(
args
.
ServiceLister
,
args
.
ControllerLister
,
args
.
ReplicaSetLister
,
args
.
StatefulSetLister
)
return
priorities
.
NewPriorityMetadataFactory
(
args
.
ServiceLister
,
args
.
ControllerLister
,
args
.
ReplicaSetLister
,
args
.
StatefulSetLister
)
})
})
...
@@ -37,7 +37,7 @@ func init() {
...
@@ -37,7 +37,7 @@ func init() {
factory
.
RegisterPriorityConfigFactory
(
factory
.
RegisterPriorityConfigFactory
(
priorities
.
ServiceSpreadingPriority
,
priorities
.
ServiceSpreadingPriority
,
factory
.
PriorityConfigFactory
{
factory
.
PriorityConfigFactory
{
MapReduceFunction
:
func
(
args
factory
.
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
args
factory
.
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
return
priorities
.
NewSelectorSpreadPriority
(
args
.
ServiceLister
,
algorithm
.
EmptyControllerLister
{},
algorithm
.
EmptyReplicaSetLister
{},
algorithm
.
EmptyStatefulSetLister
{})
return
priorities
.
NewSelectorSpreadPriority
(
args
.
ServiceLister
,
algorithm
.
EmptyControllerLister
{},
algorithm
.
EmptyReplicaSetLister
{},
algorithm
.
EmptyStatefulSetLister
{})
},
},
Weight
:
1
,
Weight
:
1
,
...
@@ -58,7 +58,7 @@ func init() {
...
@@ -58,7 +58,7 @@ func init() {
factory
.
RegisterPriorityConfigFactory
(
factory
.
RegisterPriorityConfigFactory
(
priorities
.
SelectorSpreadPriority
,
priorities
.
SelectorSpreadPriority
,
factory
.
PriorityConfigFactory
{
factory
.
PriorityConfigFactory
{
MapReduceFunction
:
func
(
args
factory
.
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
args
factory
.
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
return
priorities
.
NewSelectorSpreadPriority
(
args
.
ServiceLister
,
args
.
ControllerLister
,
args
.
ReplicaSetLister
,
args
.
StatefulSetLister
)
return
priorities
.
NewSelectorSpreadPriority
(
args
.
ServiceLister
,
args
.
ControllerLister
,
args
.
ReplicaSetLister
,
args
.
StatefulSetLister
)
},
},
Weight
:
1
,
Weight
:
1
,
...
@@ -69,7 +69,7 @@ func init() {
...
@@ -69,7 +69,7 @@ func init() {
factory
.
RegisterPriorityConfigFactory
(
factory
.
RegisterPriorityConfigFactory
(
priorities
.
InterPodAffinityPriority
,
priorities
.
InterPodAffinityPriority
,
factory
.
PriorityConfigFactory
{
factory
.
PriorityConfigFactory
{
Function
:
func
(
args
factory
.
PluginFactoryArgs
)
algorithm
.
PriorityFunction
{
Function
:
func
(
args
factory
.
PluginFactoryArgs
)
priorities
.
PriorityFunction
{
return
priorities
.
NewInterPodAffinityPriority
(
args
.
NodeInfo
,
args
.
NodeLister
,
args
.
PodLister
,
args
.
HardPodAffinitySymmetricWeight
)
return
priorities
.
NewInterPodAffinityPriority
(
args
.
NodeInfo
,
args
.
NodeLister
,
args
.
PodLister
,
args
.
HardPodAffinitySymmetricWeight
)
},
},
Weight
:
1
,
Weight
:
1
,
...
...
pkg/scheduler/core/BUILD
View file @
14b2014c
...
@@ -11,6 +11,7 @@ go_library(
...
@@ -11,6 +11,7 @@ go_library(
deps = [
deps = [
"//pkg/scheduler/algorithm:go_default_library",
"//pkg/scheduler/algorithm:go_default_library",
"//pkg/scheduler/algorithm/predicates:go_default_library",
"//pkg/scheduler/algorithm/predicates:go_default_library",
"//pkg/scheduler/algorithm/priorities:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/api:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/cache:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
"//pkg/scheduler/internal/queue:go_default_library",
...
...
pkg/scheduler/core/extender_test.go
View file @
14b2014c
...
@@ -27,6 +27,7 @@ import (
...
@@ -27,6 +27,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerinternalcache
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
schedulerinternalcache
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue
"k8s.io/kubernetes/pkg/scheduler/internal/queue"
internalqueue
"k8s.io/kubernetes/pkg/scheduler/internal/queue"
...
@@ -340,7 +341,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -340,7 +341,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
string
name
string
predicates
map
[
string
]
predicates
.
FitPredicate
predicates
map
[
string
]
predicates
.
FitPredicate
prioritizers
[]
algorithm
.
PriorityConfig
prioritizers
[]
priorities
.
PriorityConfig
extenders
[]
FakeExtender
extenders
[]
FakeExtender
nodes
[]
string
nodes
[]
string
expectedResult
ScheduleResult
expectedResult
ScheduleResult
...
@@ -348,7 +349,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -348,7 +349,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
}{
}{
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -363,7 +364,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -363,7 +364,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -378,7 +379,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -378,7 +379,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -397,7 +398,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -397,7 +398,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
machine2PredicateExtender
},
predicates
:
[]
fitPredicate
{
machine2PredicateExtender
},
...
@@ -412,7 +413,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -412,7 +413,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -430,7 +431,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -430,7 +431,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -453,7 +454,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -453,7 +454,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
},
},
{
{
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Function
:
machine2Prioritizer
,
Weight
:
20
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Function
:
machine2Prioritizer
,
Weight
:
20
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
predicates
:
[]
fitPredicate
{
truePredicateExtender
},
...
@@ -478,7 +479,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -478,7 +479,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
// because of the errors from errorPredicateExtender and/or
// because of the errors from errorPredicateExtender and/or
// errorPrioritizerExtender.
// errorPrioritizerExtender.
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Function
:
machine2Prioritizer
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Function
:
machine2Prioritizer
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
errorPredicateExtender
},
predicates
:
[]
fitPredicate
{
errorPredicateExtender
},
...
@@ -502,7 +503,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -502,7 +503,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
// If scheduler did not ignore the extender, the test would fail
// If scheduler did not ignore the extender, the test would fail
// because of the errors from errorPredicateExtender.
// because of the errors from errorPredicateExtender.
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
predicates
:
map
[
string
]
predicates
.
FitPredicate
{
"true"
:
truePredicate
},
prioritizers
:
[]
algorithm
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
prioritizers
:
[]
priorities
.
PriorityConfig
{{
Map
:
EqualPriorityMap
,
Weight
:
1
}},
extenders
:
[]
FakeExtender
{
extenders
:
[]
FakeExtender
{
{
{
predicates
:
[]
fitPredicate
{
errorPredicateExtender
},
predicates
:
[]
fitPredicate
{
errorPredicateExtender
},
...
@@ -540,7 +541,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
...
@@ -540,7 +541,7 @@ func TestGenericSchedulerWithExtenders(t *testing.T) {
test
.
predicates
,
test
.
predicates
,
predicates
.
EmptyPredicateMetadataProducer
,
predicates
.
EmptyPredicateMetadataProducer
,
test
.
prioritizers
,
test
.
prioritizers
,
algorithm
.
EmptyPriorityMetadataProducer
,
priorities
.
EmptyPriorityMetadataProducer
,
emptyPluginSet
,
emptyPluginSet
,
extenders
,
extenders
,
nil
,
nil
,
...
...
pkg/scheduler/core/generic_scheduler.go
View file @
14b2014c
...
@@ -38,6 +38,7 @@ import (
...
@@ -38,6 +38,7 @@ import (
"k8s.io/client-go/util/workqueue"
"k8s.io/client-go/util/workqueue"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerinternalcache
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
schedulerinternalcache
"k8s.io/kubernetes/pkg/scheduler/internal/cache"
internalqueue
"k8s.io/kubernetes/pkg/scheduler/internal/queue"
internalqueue
"k8s.io/kubernetes/pkg/scheduler/internal/queue"
...
@@ -115,7 +116,7 @@ type ScheduleAlgorithm interface {
...
@@ -115,7 +116,7 @@ type ScheduleAlgorithm interface {
Predicates
()
map
[
string
]
predicates
.
FitPredicate
Predicates
()
map
[
string
]
predicates
.
FitPredicate
// Prioritizers returns a slice of priority config. This is exposed for
// Prioritizers returns a slice of priority config. This is exposed for
// testing.
// testing.
Prioritizers
()
[]
algorithm
.
PriorityConfig
Prioritizers
()
[]
priorities
.
PriorityConfig
}
}
// ScheduleResult represents the result of one pod scheduled. It will contain
// ScheduleResult represents the result of one pod scheduled. It will contain
...
@@ -133,9 +134,9 @@ type genericScheduler struct {
...
@@ -133,9 +134,9 @@ type genericScheduler struct {
cache
schedulerinternalcache
.
Cache
cache
schedulerinternalcache
.
Cache
schedulingQueue
internalqueue
.
SchedulingQueue
schedulingQueue
internalqueue
.
SchedulingQueue
predicates
map
[
string
]
predicates
.
FitPredicate
predicates
map
[
string
]
predicates
.
FitPredicate
priorityMetaProducer
algorithm
.
PriorityMetadataProducer
priorityMetaProducer
priorities
.
PriorityMetadataProducer
predicateMetaProducer
predicates
.
PredicateMetadataProducer
predicateMetaProducer
predicates
.
PredicateMetadataProducer
prioritizers
[]
algorithm
.
PriorityConfig
prioritizers
[]
priorities
.
PriorityConfig
pluginSet
pluginsv1alpha1
.
PluginSet
pluginSet
pluginsv1alpha1
.
PluginSet
extenders
[]
algorithm
.
SchedulerExtender
extenders
[]
algorithm
.
SchedulerExtender
lastNodeIndex
uint64
lastNodeIndex
uint64
...
@@ -230,7 +231,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
...
@@ -230,7 +231,7 @@ func (g *genericScheduler) Schedule(pod *v1.Pod, nodeLister algorithm.NodeLister
// Prioritizers returns a slice containing all the scheduler's priority
// Prioritizers returns a slice containing all the scheduler's priority
// functions and their config. It is exposed for testing only.
// functions and their config. It is exposed for testing only.
func
(
g
*
genericScheduler
)
Prioritizers
()
[]
algorithm
.
PriorityConfig
{
func
(
g
*
genericScheduler
)
Prioritizers
()
[]
priorities
.
PriorityConfig
{
return
g
.
prioritizers
return
g
.
prioritizers
}
}
...
@@ -643,7 +644,7 @@ func PrioritizeNodes(
...
@@ -643,7 +644,7 @@ func PrioritizeNodes(
pod
*
v1
.
Pod
,
pod
*
v1
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
nodeNameToInfo
map
[
string
]
*
schedulernodeinfo
.
NodeInfo
,
meta
interface
{},
meta
interface
{},
priorityConfigs
[]
algorithm
.
PriorityConfig
,
priorityConfigs
[]
priorities
.
PriorityConfig
,
nodes
[]
*
v1
.
Node
,
nodes
[]
*
v1
.
Node
,
extenders
[]
algorithm
.
SchedulerExtender
,
extenders
[]
algorithm
.
SchedulerExtender
,
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
...
@@ -1171,8 +1172,8 @@ func NewGenericScheduler(
...
@@ -1171,8 +1172,8 @@ func NewGenericScheduler(
podQueue
internalqueue
.
SchedulingQueue
,
podQueue
internalqueue
.
SchedulingQueue
,
predicates
map
[
string
]
predicates
.
FitPredicate
,
predicates
map
[
string
]
predicates
.
FitPredicate
,
predicateMetaProducer
predicates
.
PredicateMetadataProducer
,
predicateMetaProducer
predicates
.
PredicateMetadataProducer
,
prioritizers
[]
algorithm
.
PriorityConfig
,
prioritizers
[]
priorities
.
PriorityConfig
,
priorityMetaProducer
algorithm
.
PriorityMetadataProducer
,
priorityMetaProducer
priorities
.
PriorityMetadataProducer
,
pluginSet
pluginsv1alpha1
.
PluginSet
,
pluginSet
pluginsv1alpha1
.
PluginSet
,
extenders
[]
algorithm
.
SchedulerExtender
,
extenders
[]
algorithm
.
SchedulerExtender
,
volumeBinder
*
volumebinder
.
VolumeBinder
,
volumeBinder
*
volumebinder
.
VolumeBinder
,
...
...
pkg/scheduler/core/generic_scheduler_test.go
View file @
14b2014c
This diff is collapsed.
Click to expand it.
pkg/scheduler/factory/factory.go
View file @
14b2014c
...
@@ -50,6 +50,7 @@ import (
...
@@ -50,6 +50,7 @@ import (
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
kubeletapis
"k8s.io/kubernetes/pkg/kubelet/apis"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
"k8s.io/kubernetes/pkg/scheduler/api/validation"
"k8s.io/kubernetes/pkg/scheduler/api/validation"
"k8s.io/kubernetes/pkg/scheduler/core"
"k8s.io/kubernetes/pkg/scheduler/core"
...
@@ -916,7 +917,7 @@ func (n *nodeLister) List() ([]*v1.Node, error) {
...
@@ -916,7 +917,7 @@ func (n *nodeLister) List() ([]*v1.Node, error) {
return
n
.
NodeLister
.
List
(
labels
.
Everything
())
return
n
.
NodeLister
.
List
(
labels
.
Everything
())
}
}
func
(
c
*
configFactory
)
GetPriorityFunctionConfigs
(
priorityKeys
sets
.
String
)
([]
algorithm
.
PriorityConfig
,
error
)
{
func
(
c
*
configFactory
)
GetPriorityFunctionConfigs
(
priorityKeys
sets
.
String
)
([]
priorities
.
PriorityConfig
,
error
)
{
pluginArgs
,
err
:=
c
.
getPluginArgs
()
pluginArgs
,
err
:=
c
.
getPluginArgs
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -925,7 +926,7 @@ func (c *configFactory) GetPriorityFunctionConfigs(priorityKeys sets.String) ([]
...
@@ -925,7 +926,7 @@ func (c *configFactory) GetPriorityFunctionConfigs(priorityKeys sets.String) ([]
return
getPriorityFunctionConfigs
(
priorityKeys
,
*
pluginArgs
)
return
getPriorityFunctionConfigs
(
priorityKeys
,
*
pluginArgs
)
}
}
func
(
c
*
configFactory
)
GetPriorityMetadataProducer
()
(
algorithm
.
PriorityMetadataProducer
,
error
)
{
func
(
c
*
configFactory
)
GetPriorityMetadataProducer
()
(
priorities
.
PriorityMetadataProducer
,
error
)
{
pluginArgs
,
err
:=
c
.
getPluginArgs
()
pluginArgs
,
err
:=
c
.
getPluginArgs
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
pkg/scheduler/factory/plugins.go
View file @
14b2014c
...
@@ -51,7 +51,7 @@ type PluginFactoryArgs struct {
...
@@ -51,7 +51,7 @@ type PluginFactoryArgs struct {
}
}
// PriorityMetadataProducerFactory produces PriorityMetadataProducer from the given args.
// PriorityMetadataProducerFactory produces PriorityMetadataProducer from the given args.
type
PriorityMetadataProducerFactory
func
(
PluginFactoryArgs
)
algorithm
.
PriorityMetadataProducer
type
PriorityMetadataProducerFactory
func
(
PluginFactoryArgs
)
priorities
.
PriorityMetadataProducer
// PredicateMetadataProducerFactory produces PredicateMetadataProducer from the given args.
// PredicateMetadataProducerFactory produces PredicateMetadataProducer from the given args.
type
PredicateMetadataProducerFactory
func
(
PluginFactoryArgs
)
predicates
.
PredicateMetadataProducer
type
PredicateMetadataProducerFactory
func
(
PluginFactoryArgs
)
predicates
.
PredicateMetadataProducer
...
@@ -62,12 +62,12 @@ type FitPredicateFactory func(PluginFactoryArgs) predicates.FitPredicate
...
@@ -62,12 +62,12 @@ type FitPredicateFactory func(PluginFactoryArgs) predicates.FitPredicate
// PriorityFunctionFactory produces a PriorityConfig from the given args.
// PriorityFunctionFactory produces a PriorityConfig from the given args.
// DEPRECATED
// DEPRECATED
// Use Map-Reduce pattern for priority functions.
// Use Map-Reduce pattern for priority functions.
type
PriorityFunctionFactory
func
(
PluginFactoryArgs
)
algorithm
.
PriorityFunction
type
PriorityFunctionFactory
func
(
PluginFactoryArgs
)
priorities
.
PriorityFunction
// PriorityFunctionFactory2 produces map & reduce priority functions
// PriorityFunctionFactory2 produces map & reduce priority functions
// from a given args.
// from a given args.
// FIXME: Rename to PriorityFunctionFactory.
// FIXME: Rename to PriorityFunctionFactory.
type
PriorityFunctionFactory2
func
(
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
type
PriorityFunctionFactory2
func
(
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
// PriorityConfigFactory produces a PriorityConfig from the given function and weight
// PriorityConfigFactory produces a PriorityConfig from the given function and weight
type
PriorityConfigFactory
struct
{
type
PriorityConfigFactory
struct
{
...
@@ -270,9 +270,9 @@ func RegisterPredicateMetadataProducerFactory(factory PredicateMetadataProducerF
...
@@ -270,9 +270,9 @@ func RegisterPredicateMetadataProducerFactory(factory PredicateMetadataProducerF
// with which the function was registered.
// with which the function was registered.
// DEPRECATED
// DEPRECATED
// Use Map-Reduce pattern for priority functions.
// Use Map-Reduce pattern for priority functions.
func
RegisterPriorityFunction
(
name
string
,
function
algorithm
.
PriorityFunction
,
weight
int
)
string
{
func
RegisterPriorityFunction
(
name
string
,
function
priorities
.
PriorityFunction
,
weight
int
)
string
{
return
RegisterPriorityConfigFactory
(
name
,
PriorityConfigFactory
{
return
RegisterPriorityConfigFactory
(
name
,
PriorityConfigFactory
{
Function
:
func
(
PluginFactoryArgs
)
algorithm
.
PriorityFunction
{
Function
:
func
(
PluginFactoryArgs
)
priorities
.
PriorityFunction
{
return
function
return
function
},
},
Weight
:
weight
,
Weight
:
weight
,
...
@@ -284,11 +284,11 @@ func RegisterPriorityFunction(name string, function algorithm.PriorityFunction,
...
@@ -284,11 +284,11 @@ func RegisterPriorityFunction(name string, function algorithm.PriorityFunction,
// FIXME: Rename to PriorityFunctionFactory.
// FIXME: Rename to PriorityFunctionFactory.
func
RegisterPriorityFunction2
(
func
RegisterPriorityFunction2
(
name
string
,
name
string
,
mapFunction
algorithm
.
PriorityMapFunction
,
mapFunction
priorities
.
PriorityMapFunction
,
reduceFunction
algorithm
.
PriorityReduceFunction
,
reduceFunction
priorities
.
PriorityReduceFunction
,
weight
int
)
string
{
weight
int
)
string
{
return
RegisterPriorityConfigFactory
(
name
,
PriorityConfigFactory
{
return
RegisterPriorityConfigFactory
(
name
,
PriorityConfigFactory
{
MapReduceFunction
:
func
(
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
return
mapFunction
,
reduceFunction
return
mapFunction
,
reduceFunction
},
},
Weight
:
weight
,
Weight
:
weight
,
...
@@ -315,7 +315,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
...
@@ -315,7 +315,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
if
policy
.
Argument
!=
nil
{
if
policy
.
Argument
!=
nil
{
if
policy
.
Argument
.
ServiceAntiAffinity
!=
nil
{
if
policy
.
Argument
.
ServiceAntiAffinity
!=
nil
{
pcf
=
&
PriorityConfigFactory
{
pcf
=
&
PriorityConfigFactory
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
return
priorities
.
NewServiceAntiAffinityPriority
(
return
priorities
.
NewServiceAntiAffinityPriority
(
args
.
PodLister
,
args
.
PodLister
,
args
.
ServiceLister
,
args
.
ServiceLister
,
...
@@ -326,7 +326,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
...
@@ -326,7 +326,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
}
}
}
else
if
policy
.
Argument
.
LabelPreference
!=
nil
{
}
else
if
policy
.
Argument
.
LabelPreference
!=
nil
{
pcf
=
&
PriorityConfigFactory
{
pcf
=
&
PriorityConfigFactory
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
return
priorities
.
NewNodeLabelPriority
(
return
priorities
.
NewNodeLabelPriority
(
policy
.
Argument
.
LabelPreference
.
Label
,
policy
.
Argument
.
LabelPreference
.
Label
,
policy
.
Argument
.
LabelPreference
.
Presence
,
policy
.
Argument
.
LabelPreference
.
Presence
,
...
@@ -336,7 +336,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
...
@@ -336,7 +336,7 @@ func RegisterCustomPriorityFunction(policy schedulerapi.PriorityPolicy) string {
}
}
}
else
if
policy
.
Argument
.
RequestedToCapacityRatioArguments
!=
nil
{
}
else
if
policy
.
Argument
.
RequestedToCapacityRatioArguments
!=
nil
{
pcf
=
&
PriorityConfigFactory
{
pcf
=
&
PriorityConfigFactory
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
algorithm
.
PriorityMapFunction
,
algorithm
.
PriorityReduceFunction
)
{
MapReduceFunction
:
func
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMapFunction
,
priorities
.
PriorityReduceFunction
)
{
scoringFunctionShape
:=
buildScoringFunctionShapeFromRequestedToCapacityRatioArguments
(
policy
.
Argument
.
RequestedToCapacityRatioArguments
)
scoringFunctionShape
:=
buildScoringFunctionShapeFromRequestedToCapacityRatioArguments
(
policy
.
Argument
.
RequestedToCapacityRatioArguments
)
p
:=
priorities
.
RequestedToCapacityRatioResourceAllocationPriority
(
scoringFunctionShape
)
p
:=
priorities
.
RequestedToCapacityRatioResourceAllocationPriority
(
scoringFunctionShape
)
return
p
.
PriorityMap
,
nil
return
p
.
PriorityMap
,
nil
...
@@ -431,12 +431,12 @@ func getFitPredicateFunctions(names sets.String, args PluginFactoryArgs) (map[st
...
@@ -431,12 +431,12 @@ func getFitPredicateFunctions(names sets.String, args PluginFactoryArgs) (map[st
return
predicates
,
nil
return
predicates
,
nil
}
}
func
getPriorityMetadataProducer
(
args
PluginFactoryArgs
)
(
algorithm
.
PriorityMetadataProducer
,
error
)
{
func
getPriorityMetadataProducer
(
args
PluginFactoryArgs
)
(
priorities
.
PriorityMetadataProducer
,
error
)
{
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
if
priorityMetadataProducer
==
nil
{
if
priorityMetadataProducer
==
nil
{
return
algorithm
.
EmptyPriorityMetadataProducer
,
nil
return
priorities
.
EmptyPriorityMetadataProducer
,
nil
}
}
return
priorityMetadataProducer
(
args
),
nil
return
priorityMetadataProducer
(
args
),
nil
}
}
...
@@ -451,25 +451,25 @@ func getPredicateMetadataProducer(args PluginFactoryArgs) (predicates.PredicateM
...
@@ -451,25 +451,25 @@ func getPredicateMetadataProducer(args PluginFactoryArgs) (predicates.PredicateM
return
predicateMetadataProducer
(
args
),
nil
return
predicateMetadataProducer
(
args
),
nil
}
}
func
getPriorityFunctionConfigs
(
names
sets
.
String
,
args
PluginFactoryArgs
)
([]
algorithm
.
PriorityConfig
,
error
)
{
func
getPriorityFunctionConfigs
(
names
sets
.
String
,
args
PluginFactoryArgs
)
([]
priorities
.
PriorityConfig
,
error
)
{
schedulerFactoryMutex
.
Lock
()
schedulerFactoryMutex
.
Lock
()
defer
schedulerFactoryMutex
.
Unlock
()
defer
schedulerFactoryMutex
.
Unlock
()
configs
:=
[]
algorithm
.
PriorityConfig
{}
configs
:=
[]
priorities
.
PriorityConfig
{}
for
_
,
name
:=
range
names
.
List
()
{
for
_
,
name
:=
range
names
.
List
()
{
factory
,
ok
:=
priorityFunctionMap
[
name
]
factory
,
ok
:=
priorityFunctionMap
[
name
]
if
!
ok
{
if
!
ok
{
return
nil
,
fmt
.
Errorf
(
"Invalid priority name %s specified - no corresponding function found"
,
name
)
return
nil
,
fmt
.
Errorf
(
"Invalid priority name %s specified - no corresponding function found"
,
name
)
}
}
if
factory
.
Function
!=
nil
{
if
factory
.
Function
!=
nil
{
configs
=
append
(
configs
,
algorithm
.
PriorityConfig
{
configs
=
append
(
configs
,
priorities
.
PriorityConfig
{
Name
:
name
,
Name
:
name
,
Function
:
factory
.
Function
(
args
),
Function
:
factory
.
Function
(
args
),
Weight
:
factory
.
Weight
,
Weight
:
factory
.
Weight
,
})
})
}
else
{
}
else
{
mapFunction
,
reduceFunction
:=
factory
.
MapReduceFunction
(
args
)
mapFunction
,
reduceFunction
:=
factory
.
MapReduceFunction
(
args
)
configs
=
append
(
configs
,
algorithm
.
PriorityConfig
{
configs
=
append
(
configs
,
priorities
.
PriorityConfig
{
Name
:
name
,
Name
:
name
,
Map
:
mapFunction
,
Map
:
mapFunction
,
Reduce
:
reduceFunction
,
Reduce
:
reduceFunction
,
...
@@ -484,7 +484,7 @@ func getPriorityFunctionConfigs(names sets.String, args PluginFactoryArgs) ([]al
...
@@ -484,7 +484,7 @@ func getPriorityFunctionConfigs(names sets.String, args PluginFactoryArgs) ([]al
}
}
// validateSelectedConfigs validates the config weights to avoid the overflow.
// validateSelectedConfigs validates the config weights to avoid the overflow.
func
validateSelectedConfigs
(
configs
[]
algorithm
.
PriorityConfig
)
error
{
func
validateSelectedConfigs
(
configs
[]
priorities
.
PriorityConfig
)
error
{
var
totalPriority
int
var
totalPriority
int
for
_
,
config
:=
range
configs
{
for
_
,
config
:=
range
configs
{
// Checks totalPriority against MaxTotalPriority to avoid overflow
// Checks totalPriority against MaxTotalPriority to avoid overflow
...
...
pkg/scheduler/factory/plugins_test.go
View file @
14b2014c
...
@@ -20,7 +20,6 @@ import (
...
@@ -20,7 +20,6 @@ import (
"testing"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
"k8s.io/kubernetes/pkg/scheduler/api"
"k8s.io/kubernetes/pkg/scheduler/api"
)
)
...
@@ -54,22 +53,22 @@ func TestAlgorithmNameValidation(t *testing.T) {
...
@@ -54,22 +53,22 @@ func TestAlgorithmNameValidation(t *testing.T) {
func
TestValidatePriorityConfigOverFlow
(
t
*
testing
.
T
)
{
func
TestValidatePriorityConfigOverFlow
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
tests
:=
[]
struct
{
description
string
description
string
configs
[]
algorithm
.
PriorityConfig
configs
[]
priorities
.
PriorityConfig
expected
bool
expected
bool
}{
}{
{
{
description
:
"one of the weights is MaxInt"
,
description
:
"one of the weights is MaxInt"
,
configs
:
[]
algorithm
.
PriorityConfig
{{
Weight
:
api
.
MaxInt
},
{
Weight
:
5
}},
configs
:
[]
priorities
.
PriorityConfig
{{
Weight
:
api
.
MaxInt
},
{
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
:
[]
algorithm
.
PriorityConfig
{{
Weight
:
api
.
MaxInt
/
api
.
MaxPriority
+
api
.
MaxPriority
},
{
Weight
:
5
}},
configs
:
[]
priorities
.
PriorityConfig
{{
Weight
:
api
.
MaxInt
/
api
.
MaxPriority
+
api
.
MaxPriority
},
{
Weight
:
5
}},
expected
:
true
,
expected
:
true
,
},
},
{
{
description
:
"normal weights"
,
description
:
"normal weights"
,
configs
:
[]
algorithm
.
PriorityConfig
{{
Weight
:
10000
},
{
Weight
:
5
}},
configs
:
[]
priorities
.
PriorityConfig
{{
Weight
:
10000
},
{
Weight
:
5
}},
expected
:
false
,
expected
:
false
,
},
},
}
}
...
...
pkg/scheduler/scheduler_test.go
View file @
14b2014c
...
@@ -41,6 +41,7 @@ import (
...
@@ -41,6 +41,7 @@ import (
"k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
"k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
"k8s.io/kubernetes/pkg/scheduler/algorithm/priorities"
"k8s.io/kubernetes/pkg/scheduler/api"
"k8s.io/kubernetes/pkg/scheduler/api"
kubeschedulerconfig
"k8s.io/kubernetes/pkg/scheduler/apis/config"
kubeschedulerconfig
"k8s.io/kubernetes/pkg/scheduler/apis/config"
"k8s.io/kubernetes/pkg/scheduler/core"
"k8s.io/kubernetes/pkg/scheduler/core"
...
@@ -153,7 +154,7 @@ func (es mockScheduler) Schedule(pod *v1.Pod, ml algorithm.NodeLister) (core.Sch
...
@@ -153,7 +154,7 @@ func (es mockScheduler) Schedule(pod *v1.Pod, ml algorithm.NodeLister) (core.Sch
func
(
es
mockScheduler
)
Predicates
()
map
[
string
]
predicates
.
FitPredicate
{
func
(
es
mockScheduler
)
Predicates
()
map
[
string
]
predicates
.
FitPredicate
{
return
nil
return
nil
}
}
func
(
es
mockScheduler
)
Prioritizers
()
[]
algorithm
.
PriorityConfig
{
func
(
es
mockScheduler
)
Prioritizers
()
[]
priorities
.
PriorityConfig
{
return
nil
return
nil
}
}
...
@@ -635,8 +636,8 @@ func setupTestScheduler(queuedPodStore *clientcache.FIFO, scache schedulerintern
...
@@ -635,8 +636,8 @@ func setupTestScheduler(queuedPodStore *clientcache.FIFO, scache schedulerintern
nil
,
nil
,
predicateMap
,
predicateMap
,
predicates
.
EmptyPredicateMetadataProducer
,
predicates
.
EmptyPredicateMetadataProducer
,
[]
algorithm
.
PriorityConfig
{},
[]
priorities
.
PriorityConfig
{},
algorithm
.
EmptyPriorityMetadataProducer
,
priorities
.
EmptyPriorityMetadataProducer
,
&
EmptyPluginSet
{},
&
EmptyPluginSet
{},
[]
algorithm
.
SchedulerExtender
{},
[]
algorithm
.
SchedulerExtender
{},
nil
,
nil
,
...
@@ -686,8 +687,8 @@ func setupTestSchedulerLongBindingWithRetry(queuedPodStore *clientcache.FIFO, sc
...
@@ -686,8 +687,8 @@ func setupTestSchedulerLongBindingWithRetry(queuedPodStore *clientcache.FIFO, sc
nil
,
nil
,
predicateMap
,
predicateMap
,
predicates
.
EmptyPredicateMetadataProducer
,
predicates
.
EmptyPredicateMetadataProducer
,
[]
algorithm
.
PriorityConfig
{},
[]
priorities
.
PriorityConfig
{},
algorithm
.
EmptyPriorityMetadataProducer
,
priorities
.
EmptyPriorityMetadataProducer
,
&
EmptyPluginSet
{},
&
EmptyPluginSet
{},
[]
algorithm
.
SchedulerExtender
{},
[]
algorithm
.
SchedulerExtender
{},
nil
,
nil
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment