Skip to content

Commit

Permalink
creating ByObject map before assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMHD committed Nov 11, 2023
1 parent 54e45eb commit 7466b3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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": {},
Expand Down

0 comments on commit 7466b3f

Please sign in to comment.