Remove dependency on generic.ControllerManager

This commit is contained in:
Darren Shepherd 2020-04-15 22:49:45 -07:00
parent 12cc38a2d4
commit bebae7637a

View File

@ -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{} {