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
e4ab32cd
Commit
e4ab32cd
authored
Jul 05, 2016
by
PingWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify CalculateAntiAffinityPriority function
Signed-off-by:
PingWang
<
wang.ping5@zte.com.cn
>
parent
437e133b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
selector_spreading.go
.../pkg/scheduler/algorithm/priorities/selector_spreading.go
+4
-5
No files found.
plugin/pkg/scheduler/algorithm/priorities/selector_spreading.go
View file @
e4ab32cd
...
@@ -195,6 +195,10 @@ func NewServiceAntiAffinityPriority(podLister algorithm.PodLister, serviceLister
...
@@ -195,6 +195,10 @@ func NewServiceAntiAffinityPriority(podLister algorithm.PodLister, serviceLister
// The label to be considered is provided to the struct (ServiceAntiAffinity).
// The label to be considered is provided to the struct (ServiceAntiAffinity).
func
(
s
*
ServiceAntiAffinity
)
CalculateAntiAffinityPriority
(
pod
*
api
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulercache
.
NodeInfo
,
nodeLister
algorithm
.
NodeLister
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
func
(
s
*
ServiceAntiAffinity
)
CalculateAntiAffinityPriority
(
pod
*
api
.
Pod
,
nodeNameToInfo
map
[
string
]
*
schedulercache
.
NodeInfo
,
nodeLister
algorithm
.
NodeLister
)
(
schedulerapi
.
HostPriorityList
,
error
)
{
var
nsServicePods
[]
*
api
.
Pod
var
nsServicePods
[]
*
api
.
Pod
nodes
,
err
:=
nodeLister
.
List
()
if
err
!=
nil
{
return
nil
,
err
}
if
services
,
err
:=
s
.
serviceLister
.
GetPodServices
(
pod
);
err
==
nil
{
if
services
,
err
:=
s
.
serviceLister
.
GetPodServices
(
pod
);
err
==
nil
{
// just use the first service and get the other pods within the service
// just use the first service and get the other pods within the service
...
@@ -212,11 +216,6 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, nodeNa
...
@@ -212,11 +216,6 @@ func (s *ServiceAntiAffinity) CalculateAntiAffinityPriority(pod *api.Pod, nodeNa
}
}
}
}
nodes
,
err
:=
nodeLister
.
List
()
if
err
!=
nil
{
return
nil
,
err
}
// separate out the nodes that have the label from the ones that don't
// separate out the nodes that have the label from the ones that don't
otherNodes
:=
[]
string
{}
otherNodes
:=
[]
string
{}
labeledNodes
:=
map
[
string
]
string
{}
labeledNodes
:=
map
[
string
]
string
{}
...
...
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