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
b3cb1bdc
Commit
b3cb1bdc
authored
Sep 14, 2018
by
Yecheng Fu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore non-available volumes in findMatchingVolume to reduce chance of
unnecessary binding failures.
parent
516876b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
index.go
pkg/controller/volume/persistentvolume/index.go
+8
-1
No files found.
pkg/controller/volume/persistentvolume/index.go
View file @
b3cb1bdc
...
@@ -211,11 +211,18 @@ func findMatchingVolume(
...
@@ -211,11 +211,18 @@ func findMatchingVolume(
}
}
// filter out:
// filter out:
// - volumes in non-available phase
// - volumes bound to another claim
// - volumes bound to another claim
// - volumes whose labels don't match the claim's selector, if specified
// - volumes whose labels don't match the claim's selector, if specified
// - volumes in Class that is not requested
// - volumes in Class that is not requested
// - volumes whose NodeAffinity does not match the node
// - volumes whose NodeAffinity does not match the node
if
volume
.
Spec
.
ClaimRef
!=
nil
{
if
volume
.
Status
.
Phase
!=
v1
.
VolumeAvailable
{
// We ignore volumes in non-available phase, because volumes that
// satisfies matching criteria will be updated to available, binding
// them now has high chance of encountering unnecessary failures
// due to API conflicts.
continue
}
else
if
volume
.
Spec
.
ClaimRef
!=
nil
{
continue
continue
}
else
if
selector
!=
nil
&&
!
selector
.
Matches
(
labels
.
Set
(
volume
.
Labels
))
{
}
else
if
selector
!=
nil
&&
!
selector
.
Matches
(
labels
.
Set
(
volume
.
Labels
))
{
continue
continue
...
...
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