From 695e58cca21871dbc06919885f98e80edec83868 Mon Sep 17 00:00:00 2001 From: Yijie Wang Date: Sat, 6 Jan 2024 13:51:52 -0500 Subject: [PATCH] Changed to filtered informer for APIServerSource identity service account --- pkg/reconciler/apiserversource/controller.go | 4 ++-- pkg/reconciler/apiserversource/controller_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/reconciler/apiserversource/controller.go b/pkg/reconciler/apiserversource/controller.go index ae0e38bd191..11a9355a6a8 100644 --- a/pkg/reconciler/apiserversource/controller.go +++ b/pkg/reconciler/apiserversource/controller.go @@ -39,7 +39,7 @@ import ( apiserversourceinformer "knative.dev/eventing/pkg/client/injection/informers/sources/v1/apiserversource" apiserversourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1/apiserversource" - serviceaccountinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount" + serviceaccountinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/filtered" roleinformer "knative.dev/pkg/client/injection/kube/informers/rbac/v1/role/filtered" rolebindinginformer "knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding/filtered" ) @@ -61,7 +61,7 @@ func NewController( deploymentInformer := deploymentinformer.Get(ctx) apiServerSourceInformer := apiserversourceinformer.Get(ctx) namespaceInformer := namespace.Get(ctx) - serviceaccountInformer := serviceaccountinformer.Get(ctx) + serviceaccountInformer := serviceaccountinformer.Get(ctx, sources.OIDCTokenRoleLabelSelector) // Create a selector string roleInformer := roleinformer.Get(ctx, sources.OIDCTokenRoleLabelSelector) diff --git a/pkg/reconciler/apiserversource/controller_test.go b/pkg/reconciler/apiserversource/controller_test.go index 16d9a5df23c..f4ec08b5a35 100644 --- a/pkg/reconciler/apiserversource/controller_test.go +++ b/pkg/reconciler/apiserversource/controller_test.go @@ -40,7 +40,7 @@ import ( _ "knative.dev/eventing/pkg/client/injection/informers/sources/v1/apiserversource/fake" _ "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment/fake" _ "knative.dev/pkg/client/injection/kube/informers/core/v1/namespace/fake" - _ "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/fake" + _ "knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount/filtered/fake" _ "knative.dev/pkg/client/injection/kube/informers/factory/filtered/fake" _ "knative.dev/pkg/client/injection/kube/informers/rbac/v1/role/filtered/fake" _ "knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding/filtered/fake"