From bebae7637a36119a5659738d06860af22b733519 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Wed, 15 Apr 2020 22:49:45 -0700 Subject: [PATCH] Remove dependency on generic.ControllerManager --- pkg/clustercache/controller.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/clustercache/controller.go b/pkg/clustercache/controller.go index 59cbe2d..26f4f2f 100644 --- a/pkg/clustercache/controller.go +++ b/pkg/clustercache/controller.go @@ -8,7 +8,6 @@ import ( "github.com/rancher/steve/pkg/attributes" "github.com/rancher/steve/pkg/schema" "github.com/rancher/steve/pkg/schemaserver/types" - "github.com/rancher/wrangler/pkg/generic" "github.com/rancher/wrangler/pkg/merr" "github.com/rancher/wrangler/pkg/summary/client" "github.com/rancher/wrangler/pkg/summary/informer" @@ -51,12 +50,11 @@ type watcher struct { type clusterCache struct { sync.RWMutex - ctx context.Context - typed map[schema2.GroupVersionKind]cache.SharedIndexInformer - informerFactory informer.SummarySharedInformerFactory - controllerFactory generic.ControllerManager - watchers map[schema2.GroupVersionResource]*watcher - workqueue workqueue.DelayingInterface + ctx context.Context + typed map[schema2.GroupVersionKind]cache.SharedIndexInformer + informerFactory informer.SummarySharedInformerFactory + watchers map[schema2.GroupVersionResource]*watcher + workqueue workqueue.DelayingInterface addHandlers cancelCollection removeHandlers cancelCollection @@ -192,15 +190,11 @@ func (h *clusterCache) OnSchemas(schemas *schema.Collection) error { cache.WaitForCacheSync(w.ctx.Done(), w.informer.HasSynced) } - var errs []error for _, w := range toStart { - if err := h.controllerFactory.EnsureStart(w.ctx, w.gvk, 5); err != nil { - errs = append(errs, err) - } h.watchers[w.gvr] = w } - return merr.NewErrors(errs...) + return nil } func (h *clusterCache) List(gvr schema2.GroupVersionResource) []interface{} {