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
5554dbf9
Commit
5554dbf9
authored
Nov 01, 2016
by
Harry Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix invalid predicates describe
parent
076051b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
predicates.go
plugin/pkg/scheduler/algorithm/predicates/predicates.go
+6
-6
No files found.
plugin/pkg/scheduler/algorithm/predicates/predicates.go
View file @
5554dbf9
...
@@ -721,7 +721,7 @@ func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister al
...
@@ -721,7 +721,7 @@ func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister al
// The pod has all information necessary to check affinity, the pod's label selector is sufficient to calculate
// The pod has all information necessary to check affinity, the pod's label selector is sufficient to calculate
// the match.
// the match.
// Otherwise:
// Otherwise:
// Create an "implicit selector" which g
au
rantees pods will land on nodes with similar values
// Create an "implicit selector" which g
ua
rantees pods will land on nodes with similar values
// for the affinity labels.
// for the affinity labels.
//
//
// To do this, we "reverse engineer" a selector by introspecting existing pods running under the same service+namespace.
// To do this, we "reverse engineer" a selector by introspecting existing pods running under the same service+namespace.
...
@@ -730,8 +730,8 @@ func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister al
...
@@ -730,8 +730,8 @@ func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister al
// - L is not defined in the pod itself already.
// - L is not defined in the pod itself already.
// - and SOME pod, from a service, in the same namespace, ALREADY scheduled onto a node, has a matching value.
// - and SOME pod, from a service, in the same namespace, ALREADY scheduled onto a node, has a matching value.
//
//
// WARNING: This Predicate is NOT g
au
ranteed to work if some of the predicateMetadata data isn't precomputed...
// WARNING: This Predicate is NOT g
ua
ranteed to work if some of the predicateMetadata data isn't precomputed...
// For that reason it is not exported, i.e. it is highl
h
y coupled to the implementation of the FitPredicate construction.
// For that reason it is not exported, i.e. it is highly coupled to the implementation of the FitPredicate construction.
func
(
s
*
ServiceAffinity
)
checkServiceAffinity
(
pod
*
api
.
Pod
,
meta
interface
{},
nodeInfo
*
schedulercache
.
NodeInfo
)
(
bool
,
[]
algorithm
.
PredicateFailureReason
,
error
)
{
func
(
s
*
ServiceAffinity
)
checkServiceAffinity
(
pod
*
api
.
Pod
,
meta
interface
{},
nodeInfo
*
schedulercache
.
NodeInfo
)
(
bool
,
[]
algorithm
.
PredicateFailureReason
,
error
)
{
var
services
[]
*
api
.
Service
var
services
[]
*
api
.
Service
var
pods
[]
*
api
.
Pod
var
pods
[]
*
api
.
Pod
...
@@ -1087,7 +1087,7 @@ func (c *PodAffinityChecker) satisfiesPodsAffinityAntiAffinity(pod *api.Pod, nod
...
@@ -1087,7 +1087,7 @@ func (c *PodAffinityChecker) satisfiesPodsAffinityAntiAffinity(pod *api.Pod, nod
return
false
return
false
}
}
if
!
termMatches
{
if
!
termMatches
{
// If the requirement matches a pod's own labels a
n
e namespace, and there are
// If the requirement matches a pod's own labels a
r
e namespace, and there are
// no other such pods, then disregard the requirement. This is necessary to
// no other such pods, then disregard the requirement. This is necessary to
// not block forever because the first pod of the collection can't be scheduled.
// not block forever because the first pod of the collection can't be scheduled.
match
,
err
:=
priorityutil
.
PodMatchesTermsNamespaceAndSelector
(
pod
,
pod
,
&
term
)
match
,
err
:=
priorityutil
.
PodMatchesTermsNamespaceAndSelector
(
pod
,
pod
,
&
term
)
...
@@ -1192,7 +1192,7 @@ func CheckNodeMemoryPressurePredicate(pod *api.Pod, meta interface{}, nodeInfo *
...
@@ -1192,7 +1192,7 @@ func CheckNodeMemoryPressurePredicate(pod *api.Pod, meta interface{}, nodeInfo *
return
true
,
nil
,
nil
return
true
,
nil
,
nil
}
}
// is node under presure?
// is node under pres
s
ure?
for
_
,
cond
:=
range
node
.
Status
.
Conditions
{
for
_
,
cond
:=
range
node
.
Status
.
Conditions
{
if
cond
.
Type
==
api
.
NodeMemoryPressure
&&
cond
.
Status
==
api
.
ConditionTrue
{
if
cond
.
Type
==
api
.
NodeMemoryPressure
&&
cond
.
Status
==
api
.
ConditionTrue
{
return
false
,
[]
algorithm
.
PredicateFailureReason
{
ErrNodeUnderMemoryPressure
},
nil
return
false
,
[]
algorithm
.
PredicateFailureReason
{
ErrNodeUnderMemoryPressure
},
nil
...
@@ -1210,7 +1210,7 @@ func CheckNodeDiskPressurePredicate(pod *api.Pod, meta interface{}, nodeInfo *sc
...
@@ -1210,7 +1210,7 @@ func CheckNodeDiskPressurePredicate(pod *api.Pod, meta interface{}, nodeInfo *sc
return
false
,
nil
,
fmt
.
Errorf
(
"node not found"
)
return
false
,
nil
,
fmt
.
Errorf
(
"node not found"
)
}
}
// is node under presure?
// is node under pres
s
ure?
for
_
,
cond
:=
range
node
.
Status
.
Conditions
{
for
_
,
cond
:=
range
node
.
Status
.
Conditions
{
if
cond
.
Type
==
api
.
NodeDiskPressure
&&
cond
.
Status
==
api
.
ConditionTrue
{
if
cond
.
Type
==
api
.
NodeDiskPressure
&&
cond
.
Status
==
api
.
ConditionTrue
{
return
false
,
[]
algorithm
.
PredicateFailureReason
{
ErrNodeUnderDiskPressure
},
nil
return
false
,
[]
algorithm
.
PredicateFailureReason
{
ErrNodeUnderDiskPressure
},
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