Skip to content

Commit

Permalink
Merge pull request #745 from pohly/deleted-object
Browse files Browse the repository at this point in the history
controller: handle cache.DeletedFinalStateUnknown
  • Loading branch information
k8s-ci-robot authored Jun 7, 2022
2 parents d42c79b + a60591d commit 378a8ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ func NewCSIProvisioner(client kubernetes.Interface,
// Remove deleted PVCs from rate limiter.
claimHandler := cache.ResourceEventHandlerFuncs{
DeleteFunc: func(obj interface{}) {
if unknown, ok := obj.(cache.DeletedFinalStateUnknown); ok && unknown.Obj != nil {
obj = unknown.Obj
}
if claim, ok := obj.(*v1.PersistentVolumeClaim); ok {
provisioner.nodeDeployment.rateLimiter.Forget(claim.UID)
}
Expand Down

0 comments on commit 378a8ad

Please sign in to comment.