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
8cb5bc49
Unverified
Commit
8cb5bc49
authored
Jan 08, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Jan 08, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72636 from mesaugat/patch-1
Aesthetic changes and fix typo
parents
cb7ba72f
926cabfc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
pv_controller.go
pkg/controller/volume/persistentvolume/pv_controller.go
+7
-7
No files found.
pkg/controller/volume/persistentvolume/pv_controller.go
View file @
8cb5bc49
...
@@ -247,7 +247,7 @@ func (ctrl *PersistentVolumeController) syncClaim(claim *v1.PersistentVolumeClai
...
@@ -247,7 +247,7 @@ func (ctrl *PersistentVolumeController) syncClaim(claim *v1.PersistentVolumeClai
}
}
}
}
//checkVolumeSatisfyClaim checks if the volume requested by the claim satisfies the requirements of the claim
//
checkVolumeSatisfyClaim checks if the volume requested by the claim satisfies the requirements of the claim
func
checkVolumeSatisfyClaim
(
volume
*
v1
.
PersistentVolume
,
claim
*
v1
.
PersistentVolumeClaim
)
error
{
func
checkVolumeSatisfyClaim
(
volume
*
v1
.
PersistentVolume
,
claim
*
v1
.
PersistentVolumeClaim
)
error
{
requestedQty
:=
claim
.
Spec
.
Resources
.
Requests
[
v1
.
ResourceName
(
v1
.
ResourceStorage
)]
requestedQty
:=
claim
.
Spec
.
Resources
.
Requests
[
v1
.
ResourceName
(
v1
.
ResourceStorage
)]
requestedSize
:=
requestedQty
.
Value
()
requestedSize
:=
requestedQty
.
Value
()
...
@@ -392,10 +392,10 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
...
@@ -392,10 +392,10 @@ func (ctrl *PersistentVolumeController) syncUnboundClaim(claim *v1.PersistentVol
klog
.
V
(
4
)
.
Infof
(
"synchronizing unbound PersistentVolumeClaim[%s]: volume is unbound, binding"
,
claimToClaimKey
(
claim
))
klog
.
V
(
4
)
.
Infof
(
"synchronizing unbound PersistentVolumeClaim[%s]: volume is unbound, binding"
,
claimToClaimKey
(
claim
))
if
err
=
checkVolumeSatisfyClaim
(
volume
,
claim
);
err
!=
nil
{
if
err
=
checkVolumeSatisfyClaim
(
volume
,
claim
);
err
!=
nil
{
klog
.
V
(
4
)
.
Infof
(
"Can't bind the claim to volume %q: %v"
,
volume
.
Name
,
err
)
klog
.
V
(
4
)
.
Infof
(
"Can't bind the claim to volume %q: %v"
,
volume
.
Name
,
err
)
//send an event
//
send an event
msg
:=
fmt
.
Sprintf
(
"Cannot bind to requested volume %q: %s"
,
volume
.
Name
,
err
)
msg
:=
fmt
.
Sprintf
(
"Cannot bind to requested volume %q: %s"
,
volume
.
Name
,
err
)
ctrl
.
eventRecorder
.
Event
(
claim
,
v1
.
EventTypeWarning
,
events
.
VolumeMismatch
,
msg
)
ctrl
.
eventRecorder
.
Event
(
claim
,
v1
.
EventTypeWarning
,
events
.
VolumeMismatch
,
msg
)
//volume does not satisfy the requirements of the claim
//
volume does not satisfy the requirements of the claim
if
_
,
err
=
ctrl
.
updateClaimStatus
(
claim
,
v1
.
ClaimPending
,
nil
);
err
!=
nil
{
if
_
,
err
=
ctrl
.
updateClaimStatus
(
claim
,
v1
.
ClaimPending
,
nil
);
err
!=
nil
{
return
err
return
err
}
}
...
@@ -549,7 +549,7 @@ func (ctrl *PersistentVolumeController) syncVolume(volume *v1.PersistentVolume)
...
@@ -549,7 +549,7 @@ func (ctrl *PersistentVolumeController) syncVolume(volume *v1.PersistentVolume)
// 2) apiserver if not found in informer cache
// 2) apiserver if not found in informer cache
// to make sure we will not reclaim a PV wrongly.
// to make sure we will not reclaim a PV wrongly.
// Note that only non-released and non-failed volumes will be
// Note that only non-released and non-failed volumes will be
// updated to Released state when PVC does not e
ix
st.
// updated to Released state when PVC does not e
xi
st.
if
volume
.
Status
.
Phase
!=
v1
.
VolumeReleased
&&
volume
.
Status
.
Phase
!=
v1
.
VolumeFailed
{
if
volume
.
Status
.
Phase
!=
v1
.
VolumeReleased
&&
volume
.
Status
.
Phase
!=
v1
.
VolumeFailed
{
obj
,
err
=
ctrl
.
claimLister
.
PersistentVolumeClaims
(
volume
.
Spec
.
ClaimRef
.
Namespace
)
.
Get
(
volume
.
Spec
.
ClaimRef
.
Name
)
obj
,
err
=
ctrl
.
claimLister
.
PersistentVolumeClaims
(
volume
.
Spec
.
ClaimRef
.
Namespace
)
.
Get
(
volume
.
Spec
.
ClaimRef
.
Name
)
if
err
!=
nil
&&
!
apierrs
.
IsNotFound
(
err
)
{
if
err
!=
nil
&&
!
apierrs
.
IsNotFound
(
err
)
{
...
@@ -1096,8 +1096,8 @@ func (ctrl *PersistentVolumeController) reclaimVolume(volume *v1.PersistentVolum
...
@@ -1096,8 +1096,8 @@ func (ctrl *PersistentVolumeController) reclaimVolume(volume *v1.PersistentVolum
return
nil
return
nil
}
}
//
doRerecycleVolumeOperationcycleVolume recycles a volume. This method is
//
recycleVolumeOperation recycles a volume. This method is running in
//
running in
standalone goroutine and already has all necessary locks.
// standalone goroutine and already has all necessary locks.
func
(
ctrl
*
PersistentVolumeController
)
recycleVolumeOperation
(
volume
*
v1
.
PersistentVolume
)
{
func
(
ctrl
*
PersistentVolumeController
)
recycleVolumeOperation
(
volume
*
v1
.
PersistentVolume
)
{
klog
.
V
(
4
)
.
Infof
(
"recycleVolumeOperation [%s] started"
,
volume
.
Name
)
klog
.
V
(
4
)
.
Infof
(
"recycleVolumeOperation [%s] started"
,
volume
.
Name
)
...
@@ -1331,7 +1331,7 @@ func (ctrl *PersistentVolumeController) isVolumeUsed(pv *v1.PersistentVolume) ([
...
@@ -1331,7 +1331,7 @@ func (ctrl *PersistentVolumeController) isVolumeUsed(pv *v1.PersistentVolume) ([
// doDeleteVolume finds appropriate delete plugin and deletes given volume, returning
// doDeleteVolume finds appropriate delete plugin and deletes given volume, returning
// the volume plugin name. Also, it returns 'true', when the volume was deleted and
// the volume plugin name. Also, it returns 'true', when the volume was deleted and
// 'false' when the volume cannot be deleted because
of
the deleter is external. No
// 'false' when the volume cannot be deleted because the deleter is external. No
// error should be reported in this case.
// error should be reported in this case.
func
(
ctrl
*
PersistentVolumeController
)
doDeleteVolume
(
volume
*
v1
.
PersistentVolume
)
(
string
,
bool
,
error
)
{
func
(
ctrl
*
PersistentVolumeController
)
doDeleteVolume
(
volume
*
v1
.
PersistentVolume
)
(
string
,
bool
,
error
)
{
klog
.
V
(
4
)
.
Infof
(
"doDeleteVolume [%s]"
,
volume
.
Name
)
klog
.
V
(
4
)
.
Infof
(
"doDeleteVolume [%s]"
,
volume
.
Name
)
...
...
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