diff --git a/pkg/controller/volume/attachdetach/attach_detach_controller.go b/pkg/controller/volume/attachdetach/attach_detach_controller.go index f0e3774f5ca..eab677b0dc1 100644 --- a/pkg/controller/volume/attachdetach/attach_detach_controller.go +++ b/pkg/controller/volume/attachdetach/attach_detach_controller.go @@ -203,9 +203,12 @@ func NewAttachDetachController( // This custom indexer will index pods by its PVC keys. Then we don't need // to iterate all pods every time to find pods which reference given PVC. - adc.podIndexer.AddIndexers(kcache.Indexers{ + err := adc.podIndexer.AddIndexers(kcache.Indexers{ pvcKeyIndex: indexByPVCKey, }) + if err != nil { + klog.Warningf("adding indexer got %v", err) + } nodeInformer.Informer().AddEventHandler(kcache.ResourceEventHandlerFuncs{ AddFunc: adc.nodeAdd,