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
95eb3a67
Unverified
Commit
95eb3a67
authored
May 07, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77452 from cwdsuzhou/fix_error_overrided
fix always print EventTypeWarning due to err override
parents
e3320514
722f42ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
volume_resize_map.go
pkg/controller/volume/expand/cache/volume_resize_map.go
+1
-1
expand_controller.go
pkg/controller/volume/expand/expand_controller.go
+3
-3
pvc_populator.go
pkg/controller/volume/expand/pvc_populator.go
+3
-3
No files found.
pkg/controller/volume/expand/cache/volume_resize_map.go
View file @
95eb3a67
...
...
@@ -92,7 +92,7 @@ func NewVolumeResizeMap(kubeClient clientset.Interface) VolumeResizeMap {
// AddPVCUpdate adds pvc for resizing
// This function intentionally allows addition of PVCs for which pv.Spec.Size >= pvc.Spec.Size,
// the reason being - lack of transaction in k8s means after successful resize, we can't guarantee that when we update PV,
// pvc update will be successful too and after resize we al
y
ways update PV first.
// pvc update will be successful too and after resize we always update PV first.
// If for some reason we weren't able to update PVC after successful resize, then we are going to reprocess
// the PVC and hopefully after a no-op resize in volume plugin, PVC will be updated with right values as well.
func
(
resizeMap
*
volumeResizeMap
)
AddPVCUpdate
(
pvc
*
v1
.
PersistentVolumeClaim
,
pv
*
v1
.
PersistentVolume
)
{
...
...
pkg/controller/volume/expand/expand_controller.go
View file @
95eb3a67
...
...
@@ -211,16 +211,16 @@ func (expc *expandController) pvcUpdate(oldObj, newObj interface{}) {
volumeSpec
:=
volume
.
NewSpecFromPersistentVolume
(
pv
,
false
)
volumePlugin
,
err
:=
expc
.
volumePluginMgr
.
FindExpandablePluginBySpec
(
volumeSpec
)
if
err
!=
nil
||
volumePlugin
==
nil
{
err
=
fmt
.
Errorf
(
"didn't find a plugin capable of expanding the volume; "
+
retErr
:
=
fmt
.
Errorf
(
"didn't find a plugin capable of expanding the volume; "
+
"waiting for an external controller to process this PVC"
)
eventType
:=
v1
.
EventTypeNormal
if
err
!=
nil
{
eventType
=
v1
.
EventTypeWarning
}
expc
.
recorder
.
Event
(
newPVC
,
eventType
,
events
.
ExternalExpanding
,
fmt
.
Sprintf
(
"Ignoring the PVC: %v."
,
e
rr
))
fmt
.
Sprintf
(
"Ignoring the PVC: %v."
,
retE
rr
))
klog
.
V
(
3
)
.
Infof
(
"Ignoring the PVC %q (uid: %q) : %v."
,
util
.
GetPersistentVolumeClaimQualifiedName
(
newPVC
),
newPVC
.
UID
,
e
rr
)
util
.
GetPersistentVolumeClaimQualifiedName
(
newPVC
),
newPVC
.
UID
,
retE
rr
)
return
}
expc
.
resizeMap
.
AddPVCUpdate
(
newPVC
,
pv
)
...
...
pkg/controller/volume/expand/pvc_populator.go
View file @
95eb3a67
...
...
@@ -102,16 +102,16 @@ func (populator *pvcPopulator) Sync() {
volumeSpec
:=
volume
.
NewSpecFromPersistentVolume
(
pv
,
false
)
volumePlugin
,
err
:=
populator
.
volumePluginMgr
.
FindExpandablePluginBySpec
(
volumeSpec
)
if
(
err
!=
nil
||
volumePlugin
==
nil
)
&&
pvcStatusSize
.
Cmp
(
pvcSize
)
<
0
{
err
=
fmt
.
Errorf
(
"didn't find a plugin capable of expanding the volume; "
+
retErr
:
=
fmt
.
Errorf
(
"didn't find a plugin capable of expanding the volume; "
+
"waiting for an external controller to process this PVC"
)
eventType
:=
v1
.
EventTypeNormal
if
err
!=
nil
{
eventType
=
v1
.
EventTypeWarning
}
populator
.
recorder
.
Event
(
pvc
,
eventType
,
events
.
ExternalExpanding
,
fmt
.
Sprintf
(
"Ignoring the PVC: %v."
,
e
rr
))
fmt
.
Sprintf
(
"Ignoring the PVC: %v."
,
retE
rr
))
klog
.
V
(
3
)
.
Infof
(
"Ignoring the PVC %q (uid: %q) : %v."
,
util
.
GetPersistentVolumeClaimQualifiedName
(
pvc
),
pvc
.
UID
,
e
rr
)
util
.
GetPersistentVolumeClaimQualifiedName
(
pvc
),
pvc
.
UID
,
retE
rr
)
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