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
71d06404
Unverified
Commit
71d06404
authored
Apr 24, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 24, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76883 from hex108/cancel
Cancel processing node if error occurs when getting affinity and anti…
parents
5f3152e2
5ad4cd6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
metadata.go
pkg/scheduler/algorithm/predicates/metadata.go
+8
-2
No files found.
pkg/scheduler/algorithm/predicates/metadata.go
View file @
71d06404
...
@@ -389,6 +389,8 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
...
@@ -389,6 +389,8 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
}
}
}
}
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
processNode
:=
func
(
i
int
)
{
processNode
:=
func
(
i
int
)
{
nodeInfo
:=
nodeInfoMap
[
allNodeNames
[
i
]]
nodeInfo
:=
nodeInfoMap
[
allNodeNames
[
i
]]
node
:=
nodeInfo
.
Node
()
node
:=
nodeInfo
.
Node
()
...
@@ -400,12 +402,13 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
...
@@ -400,12 +402,13 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
existingPodTopologyMaps
,
err
:=
getMatchingAntiAffinityTopologyPairsOfPod
(
pod
,
existingPod
,
node
)
existingPodTopologyMaps
,
err
:=
getMatchingAntiAffinityTopologyPairsOfPod
(
pod
,
existingPod
,
node
)
if
err
!=
nil
{
if
err
!=
nil
{
catchError
(
err
)
catchError
(
err
)
cancel
()
return
return
}
}
appendTopologyPairsMaps
(
existingPodTopologyMaps
)
appendTopologyPairsMaps
(
existingPodTopologyMaps
)
}
}
}
}
workqueue
.
ParallelizeUntil
(
c
ontext
.
TODO
()
,
16
,
len
(
allNodeNames
),
processNode
)
workqueue
.
ParallelizeUntil
(
c
tx
,
16
,
len
(
allNodeNames
),
processNode
)
return
topologyMaps
,
firstError
return
topologyMaps
,
firstError
}
}
...
@@ -454,6 +457,8 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
...
@@ -454,6 +457,8 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
}
}
antiAffinityTerms
:=
GetPodAntiAffinityTerms
(
affinity
.
PodAntiAffinity
)
antiAffinityTerms
:=
GetPodAntiAffinityTerms
(
affinity
.
PodAntiAffinity
)
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
processNode
:=
func
(
i
int
)
{
processNode
:=
func
(
i
int
)
{
nodeInfo
:=
nodeInfoMap
[
allNodeNames
[
i
]]
nodeInfo
:=
nodeInfoMap
[
allNodeNames
[
i
]]
node
:=
nodeInfo
.
Node
()
node
:=
nodeInfo
.
Node
()
...
@@ -479,6 +484,7 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
...
@@ -479,6 +484,7 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
selector
,
err
:=
metav1
.
LabelSelectorAsSelector
(
term
.
LabelSelector
)
selector
,
err
:=
metav1
.
LabelSelectorAsSelector
(
term
.
LabelSelector
)
if
err
!=
nil
{
if
err
!=
nil
{
catchError
(
err
)
catchError
(
err
)
cancel
()
return
return
}
}
if
priorityutil
.
PodMatchesTermsNamespaceAndSelector
(
existingPod
,
namespaces
,
selector
)
{
if
priorityutil
.
PodMatchesTermsNamespaceAndSelector
(
existingPod
,
namespaces
,
selector
)
{
...
@@ -493,7 +499,7 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
...
@@ -493,7 +499,7 @@ func getTPMapMatchingIncomingAffinityAntiAffinity(pod *v1.Pod, nodeInfoMap map[s
appendResult
(
node
.
Name
,
nodeTopologyPairsAffinityPodsMaps
,
nodeTopologyPairsAntiAffinityPodsMaps
)
appendResult
(
node
.
Name
,
nodeTopologyPairsAffinityPodsMaps
,
nodeTopologyPairsAntiAffinityPodsMaps
)
}
}
}
}
workqueue
.
ParallelizeUntil
(
c
ontext
.
TODO
()
,
16
,
len
(
allNodeNames
),
processNode
)
workqueue
.
ParallelizeUntil
(
c
tx
,
16
,
len
(
allNodeNames
),
processNode
)
return
topologyPairsAffinityPodsMaps
,
topologyPairsAntiAffinityPodsMaps
,
firstError
return
topologyPairsAffinityPodsMaps
,
topologyPairsAntiAffinityPodsMaps
,
firstError
}
}
...
...
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