Commit e6567108 authored by hzxuzhonghu's avatar hzxuzhonghu

process pvc watch deletion event miss in expand-controller

parent 18758f50
...@@ -162,9 +162,17 @@ func (expc *expandController) Run(stopCh <-chan struct{}) { ...@@ -162,9 +162,17 @@ func (expc *expandController) Run(stopCh <-chan struct{}) {
func (expc *expandController) deletePVC(obj interface{}) { func (expc *expandController) deletePVC(obj interface{}) {
pvc, ok := obj.(*v1.PersistentVolumeClaim) pvc, ok := obj.(*v1.PersistentVolumeClaim)
if !ok {
if pvc == nil || !ok { tombstone, ok := obj.(kcache.DeletedFinalStateUnknown)
return 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) expc.resizeMap.DeletePVC(pvc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment