revert SharedInformer
This reverts commit
@@ -1486,8 +1486,11 @@ func (w *Watcher) configureKubeWatch() (cache.Controller, chan struct{}) {
localPodMap := map[string]struct{}{}
- si := cache.NewSharedInformer(watchlist, &v1.Pod{}, time.Minute)
- si.AddEventHandler(cache.ResourceEventHandlerFuncs{
+ _, controller := cache.NewInformer(
+ watchlist,
+ &v1.Pod{},
+ 0,
+ cache.ResourceEventHandlerFuncs{
// --- Kube Create
AddFunc: func(obj interface{}) {
logger := w.Logger.WithFields(logrus.Fields{
@@ -1568,7 +1571,8 @@ func (w *Watcher) configureKubeWatch() (cache.Controller, chan struct{}) {
logger.Error("obj received is not of type *v1.Pod")
}
},
- })
+ },
+ )
- return si, make(chan struct{})
+ return controller, make(chan struct{})
}
