diff --git a/pkg/controller/volume/expand/expand_controller.go b/pkg/controller/volume/expand/expand_controller.go index 6d6ac0edf9b..afc03d8113b 100644 --- a/pkg/controller/volume/expand/expand_controller.go +++ b/pkg/controller/volume/expand/expand_controller.go @@ -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)