diff --git a/main.go b/main.go index 8eb9e5d..04ab7cf 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,7 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" "k8s.io/client-go/rest" controllercache "sigs.k8s.io/controller-runtime/pkg/cache" + "sigs.k8s.io/controller-runtime/pkg/client" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -141,6 +142,7 @@ func setupManager( LeaderElectionID: "f5d1781e.snappcloud.io", // limit Manager to cerberus namespace NewCache: func(config *rest.Config, opts controllercache.Options) (controllercache.Cache, error) { + opts.ByObject = make(map[client.Object]controllercache.ByObject) opts.ByObject[&v1.Secret{}] = controllercache.ByObject{ Namespaces: map[string]controllercache.Config{ "cerberus-operator-system": {},