Skip to content

Commit

Permalink
oauthendpoints: filter only relevant informer resources to the OAuthR…
Browse files Browse the repository at this point in the history
…outeCheckController
  • Loading branch information
liouk committed Nov 9, 2023
1 parent 78cce05 commit 70af11c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions pkg/controllers/oauthendpoints/oauth_endpoints_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ func NewOAuthRouteCheckController(
return getOAuthRouteTLSConfig(cmLister, secretLister, ingressLister, systemCABundle)
}

filterFunc := factory.NamesFilter(
// cluster-scoped
"cluster", // ingress

// NS: openshift-authentication
"oauth-openshift", // route
"v4-0-config-system-router-certs", // secret
"v4-0-config-system-custom-router-certs", // secret

// NS: openshift-config-managed
"default-ingress-cert", //configmap
)

return endpointaccessible.NewEndpointAccessibleController(
"OAuthServerRoute",
operatorClient,
Expand All @@ -67,6 +80,7 @@ func NewOAuthRouteCheckController(
routeInformer,
ingressInformer,
},
filterFunc,
recorder,
wait.Jitter(5*time.Minute, 0.1))
}
Expand All @@ -93,6 +107,7 @@ func NewOAuthServiceCheckController(
kubeInformersForTargetNS.Core().V1().ConfigMaps().Informer(),
kubeInformersForTargetNS.Core().V1().Services().Informer(),
},
nil,
recorder,
wait.Jitter(time.Minute, 1.0))
}
Expand Down Expand Up @@ -120,6 +135,7 @@ func NewOAuthServiceEndpointsCheckController(
kubeInformersForTargetNS.Core().V1().Endpoints().Informer(),
kubeInformersForTargetNS.Core().V1().ConfigMaps().Informer(),
},
nil,
recorder,
wait.Jitter(time.Minute, 1.0))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func NewEndpointAccessibleController(
endpointListFn EndpointListFunc,
getTLSConfigFn EndpointTLSConfigFunc,
triggers []factory.Informer,
triggersFilterFunc factory.EventFilterFunc,
recorder events.Recorder,
resyncInterval time.Duration,
) factory.Controller {
Expand All @@ -49,7 +50,7 @@ func NewEndpointAccessibleController(
}

return factory.New().
WithInformers(triggers...).
WithFilteredEventsInformers(triggersFilterFunc, triggers...).
WithInformers(operatorClient.Informer()).
WithSync(c.sync).
ResyncEvery(resyncInterval).
Expand Down

0 comments on commit 70af11c

Please sign in to comment.