From 5cdbfd5449730c8a4efc983eaedd796ce02abeef Mon Sep 17 00:00:00 2001 From: Ilias Rinis Date: Tue, 3 Oct 2023 11:45:45 +0200 Subject: [PATCH] oauthendpoints: filter only relevant configmaps and secrets to the OAuthRouteCheckController --- .../oauth_endpoints_controller.go | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/pkg/controllers/oauthendpoints/oauth_endpoints_controller.go b/pkg/controllers/oauthendpoints/oauth_endpoints_controller.go index 58b033038..9125960f0 100644 --- a/pkg/controllers/oauthendpoints/oauth_endpoints_controller.go +++ b/pkg/controllers/oauthendpoints/oauth_endpoints_controller.go @@ -57,16 +57,29 @@ func NewOAuthRouteCheckController( return getOAuthRouteTLSConfig(cmLister, secretLister, ingressLister, systemCABundle) } + filterFunc := factory.NamesFilter( + // NS: openshift-authentication + "oauth-openshift", + "v4-0-config-system-router-certs", + "v4-0-config-system-custom-router-certs", + + // NS: openshift-config-managed + "default-ingress-cert", + ) + + filteredInformers := []factory.Informer{ + cmInformer, + secretInformer, + routeInformer, + ingressInformer, + } + return endpointaccessible.NewEndpointAccessibleController( "OAuthServerRoute", operatorClient, endpointListFunc, getTLSConfigFunc, - []factory.Informer{ - cmInformer, - secretInformer, - routeInformer, - ingressInformer, - }, + nil, + filteredInformers, filterFunc, recorder, wait.Jitter(time.Minute, 5.0)) } @@ -93,6 +106,7 @@ func NewOAuthServiceCheckController( kubeInformersForTargetNS.Core().V1().ConfigMaps().Informer(), kubeInformersForTargetNS.Core().V1().Services().Informer(), }, + nil, nil, recorder, wait.Jitter(time.Minute, 1.0)) } @@ -120,6 +134,7 @@ func NewOAuthServiceEndpointsCheckController( kubeInformersForTargetNS.Core().V1().Endpoints().Informer(), kubeInformersForTargetNS.Core().V1().ConfigMaps().Informer(), }, + nil, nil, recorder, wait.Jitter(time.Minute, 1.0)) }