mirror of https://github.com/k3s-io/k3s
Merge pull request #57680 from hzxuzhonghu/volume-expand
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. process pvc watch deletion event miss in expand-controller **What this PR does / why we need it**: volume expand controller should also process exception case when watch deletion event missed as most controllers do. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/6/head
commit
2f4cca73af
|
@ -162,9 +162,17 @@ func (expc *expandController) Run(stopCh <-chan struct{}) {
|
|||
|
||||
func (expc *expandController) deletePVC(obj interface{}) {
|
||||
pvc, ok := obj.(*v1.PersistentVolumeClaim)
|
||||
|
||||
if pvc == nil || !ok {
|
||||
return
|
||||
if !ok {
|
||||
tombstone, ok := obj.(kcache.DeletedFinalStateUnknown)
|
||||
if !ok {
|
||||
runtime.HandleError(fmt.Errorf("couldn't get object from tombstone %+v", obj))
|
||||
return
|
||||
}
|
||||
pvc, ok = tombstone.Obj.(*v1.PersistentVolumeClaim)
|
||||
if !ok {
|
||||
runtime.HandleError(fmt.Errorf("tombstone contained object that is not a pvc %#v", obj))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
expc.resizeMap.DeletePVC(pvc)
|
||||
|
|
Loading…
Reference in New Issue