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
eb59bc60
Commit
eb59bc60
authored
Feb 01, 2019
by
Bobby (Babak) Salamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Short circuit volume checker if the pod is not requesting any volumes
parent
30566b99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
predicates.go
pkg/scheduler/algorithm/predicates/predicates.go
+14
-0
No files found.
pkg/scheduler/algorithm/predicates/predicates.go
View file @
eb59bc60
...
...
@@ -1642,7 +1642,21 @@ func NewVolumeBindingPredicate(binder *volumebinder.VolumeBinder) FitPredicate {
return
c
.
predicate
}
func
podHasPVCs
(
pod
*
v1
.
Pod
)
bool
{
for
_
,
vol
:=
range
pod
.
Spec
.
Volumes
{
if
vol
.
PersistentVolumeClaim
!=
nil
{
return
true
}
}
return
false
}
func
(
c
*
VolumeBindingChecker
)
predicate
(
pod
*
v1
.
Pod
,
meta
PredicateMetadata
,
nodeInfo
*
schedulernodeinfo
.
NodeInfo
)
(
bool
,
[]
PredicateFailureReason
,
error
)
{
// If pod does not request any PVC, we don't need to do anything.
if
!
podHasPVCs
(
pod
)
{
return
true
,
nil
,
nil
}
node
:=
nodeInfo
.
Node
()
if
node
==
nil
{
return
false
,
nil
,
fmt
.
Errorf
(
"node not found"
)
...
...
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