diff --git a/pkg/reconciler/brokercell/controller.go b/pkg/reconciler/brokercell/controller.go index 1f6d6e4b3e..19ac4aafe1 100644 --- a/pkg/reconciler/brokercell/controller.go +++ b/pkg/reconciler/brokercell/controller.go @@ -42,6 +42,7 @@ import ( serviceinformer "knative.dev/pkg/client/injection/kube/informers/core/v1/service" "knative.dev/pkg/configmap" "knative.dev/pkg/controller" + "knative.dev/pkg/system" ) const ( @@ -82,22 +83,17 @@ func NewController( // Watch brokers and triggers to invoke configmap update immediately. brokerinformer.Get(ctx).Informer().AddEventHandler(controller.HandleAll( func(obj interface{}) { - if b, ok := obj.(*brokerv1beta1.Broker); ok { + if _, ok := obj.(*brokerv1beta1.Broker); ok { // TODO(#866) Select the brokercell that's associated with the given broker. - impl.EnqueueKey(types.NamespacedName{Namespace: b.Namespace, Name: brokerresources.DefaultBrokerCellName}) + impl.EnqueueKey(types.NamespacedName{Namespace: system.Namespace(), Name: brokerresources.DefaultBrokerCellName}) } }, )) triggerinformer.Get(ctx).Informer().AddEventHandler(controller.HandleAll( func(obj interface{}) { - if t, ok := obj.(*brokerv1beta1.Trigger); ok { - b, err := brokerinformer.Get(ctx).Lister().Brokers(t.Namespace).Get(t.Spec.Broker) - if err != nil { - logging.FromContext(ctx).Error("Failed to get broker", zap.Error(err)) - return - } + if _, ok := obj.(*brokerv1beta1.Trigger); ok { // TODO(#866) Select the brokercell that's associated with the given broker. - impl.EnqueueKey(types.NamespacedName{Namespace: b.Namespace, Name: brokerresources.DefaultBrokerCellName}) + impl.EnqueueKey(types.NamespacedName{Namespace: system.Namespace(), Name: brokerresources.DefaultBrokerCellName}) } }, ))