Skip to content

Commit f0a6aa1

Browse files
committed
Log error from AddIndexers in NewAttachDetachController
1 parent 39ba488 commit f0a6aa1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/controller/volume/attachdetach/attach_detach_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,12 @@ func NewAttachDetachController(
203203

204204
// This custom indexer will index pods by its PVC keys. Then we don't need
205205
// to iterate all pods every time to find pods which reference given PVC.
206-
adc.podIndexer.AddIndexers(kcache.Indexers{
206+
err := adc.podIndexer.AddIndexers(kcache.Indexers{
207207
pvcKeyIndex: indexByPVCKey,
208208
})
209+
if err != nil {
210+
klog.Warningf("adding indexer got %v", err)
211+
}
209212

210213
nodeInformer.Informer().AddEventHandler(kcache.ResourceEventHandlerFuncs{
211214
AddFunc: adc.nodeAdd,

0 commit comments

Comments
 (0)