From 4b852e3e8a7757e9ca89184349604599c43aa35a Mon Sep 17 00:00:00 2001 From: Gabe Alford Date: Thu, 11 Jan 2024 11:26:30 -0700 Subject: [PATCH] fix: update controller-runtime cache handling from deprecated method --- cmd/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 6f3238ad..f187852f 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -24,6 +24,7 @@ import ( 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/client" "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -105,9 +106,8 @@ func main() { HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, LeaderElectionID: "70435a7a.crowdstrike.com", - - NewCache: cache.BuilderWithOptions(cache.Options{ - SelectorsByObject: cache.SelectorsByObject{ + Cache: cache.Options{ + ByObject: map[client.Object]cache.ByObject{ &falconv1alpha1.FalconAdmission{}: {}, &falconv1alpha1.FalconNodeSensor{}: {}, &falconv1alpha1.FalconContainer{}: {}, @@ -144,7 +144,6 @@ func main() { }, }, }, - ), } if configFile != "" {