Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global resync brokers on config-features changes #7126

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pkg/reconciler/broker/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@
configmapInformer := configmapinformer.Get(ctx)
secretInformer := secretinformer.Get(ctx)

featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"))
var globalResync func(obj interface{})

featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"), func(name string, value interface{}) {
if globalResync != nil {
globalResync(nil)
}
})
featureStore.WatchConfigs(cmw)

var err error
Expand Down Expand Up @@ -112,7 +118,7 @@
// When the endpoints in our multi-tenant filter/ingress change, do a global resync.
// During installation, we might reconcile Brokers before our shared filter/ingress is
// ready, so when these endpoints change perform a global resync.
grCb := func(obj interface{}) {
globalResync = func(obj interface{}) {

Check failure on line 121 in pkg/reconciler/broker/controller.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

`NewController$3` - `obj` is unused (unparam)
// Since changes in the Filter/Ingress Service endpoints affect all the Broker objects,
// do a global resync.
logger.Info("Doing a global resync due to endpoint changes in shared broker component")
Expand All @@ -123,18 +129,18 @@
FilterFunc: pkgreconciler.ChainFilterFuncs(
pkgreconciler.NamespaceFilterFunc(system.Namespace()),
pkgreconciler.NameFilterFunc(names.BrokerFilterName)),
Handler: controller.HandleAll(grCb),
Handler: controller.HandleAll(globalResync),
})
// Resync for the ingress.
endpointsInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: pkgreconciler.ChainFilterFuncs(
pkgreconciler.NamespaceFilterFunc(system.Namespace()),
pkgreconciler.NameFilterFunc(names.BrokerIngressName)),
Handler: controller.HandleAll(grCb),
Handler: controller.HandleAll(globalResync),
})
secretInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{
FilterFunc: controller.FilterWithName(ingressServerTLSSecretName),
Handler: controller.HandleAll(grCb),
Handler: controller.HandleAll(globalResync),
})

return impl
Expand Down
Loading