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
19ebaf28
Commit
19ebaf28
authored
Aug 25, 2017
by
Matthew Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't update pvc.status.capacity if pvc is already Bound
parent
1f580ae8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
pv_controller.go
pkg/controller/volume/persistentvolume/pv_controller.go
+13
-8
No files found.
pkg/controller/volume/persistentvolume/pv_controller.go
View file @
19ebaf28
...
@@ -625,14 +625,19 @@ func (ctrl *PersistentVolumeController) updateClaimStatus(claim *v1.PersistentVo
...
@@ -625,14 +625,19 @@ func (ctrl *PersistentVolumeController) updateClaimStatus(claim *v1.PersistentVo
dirty
=
true
dirty
=
true
}
}
volumeCap
,
ok
:=
volume
.
Spec
.
Capacity
[
v1
.
ResourceStorage
]
// Update Capacity if the claim is becoming Bound, not if it was already.
if
!
ok
{
// A discrepancy can be intentional to mean that the PVC filesystem size
return
nil
,
fmt
.
Errorf
(
"PersistentVolume %q is without a storage capacity"
,
volume
.
Name
)
// doesn't match the PV block device size, so don't clobber it
}
if
claim
.
Status
.
Phase
!=
phase
{
claimCap
,
ok
:=
claim
.
Status
.
Capacity
[
v1
.
ResourceStorage
]
volumeCap
,
ok
:=
volume
.
Spec
.
Capacity
[
v1
.
ResourceStorage
]
if
!
ok
||
volumeCap
.
Cmp
(
claimCap
)
!=
0
{
if
!
ok
{
claimClone
.
Status
.
Capacity
=
volume
.
Spec
.
Capacity
return
nil
,
fmt
.
Errorf
(
"PersistentVolume %q is without a storage capacity"
,
volume
.
Name
)
dirty
=
true
}
claimCap
,
ok
:=
claim
.
Status
.
Capacity
[
v1
.
ResourceStorage
]
if
!
ok
||
volumeCap
.
Cmp
(
claimCap
)
!=
0
{
claimClone
.
Status
.
Capacity
=
volume
.
Spec
.
Capacity
dirty
=
true
}
}
}
}
}
...
...
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