From 0f6125c7cfe4529f15de221f52dbde571c2f829d Mon Sep 17 00:00:00 2001 From: Alan-pad <46325799+Alan-pad@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:00:59 +0200 Subject: [PATCH] fix(cache): remove multicachenamespace (#142) --- internal/controllers/manager.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/controllers/manager.go b/internal/controllers/manager.go index 12cc6174..862ddc0e 100644 --- a/internal/controllers/manager.go +++ b/internal/controllers/manager.go @@ -25,7 +25,6 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/healthz" log "github.com/sirupsen/logrus" @@ -76,7 +75,10 @@ func (c *Controllers) Exec() { HealthProbeBindAddress: c.config.Controller.HealthProbeBindAddress, LeaderElection: c.config.Controller.LeaderElection.Enabled, LeaderElectionID: c.config.Controller.LeaderElection.ID, - NewCache: cache.MultiNamespacedCacheBuilder(c.config.Controller.WatchedNamespaces), + // NewCache: func(config *rest.Config, cacheOpts cache.Options) (cache.Cache, error) { + // cacheOpts.Namespaces = c.config.Controller.WatchedNamespaces + // return cache.New(config, cacheOpts) + // }}) }) if err != nil { log.Fatalf("unable to start manager: %s", err)