From f0a6aa1e9b3673580380f20ef5b5355ee5f13eb5 Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Mon, 7 Oct 2019 16:15:25 -0700 Subject: [PATCH] Log error from AddIndexers in NewAttachDetachController --- .../volume/attachdetach/attach_detach_controller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,