Skip to content

Commit

Permalink
[release-1.11] fix mt-broker-ingress watch Broker (#7512)
Browse files Browse the repository at this point in the history
* fix mt-broker-ingress watch Broker

Signed-off-by: pingjiang <[email protected]>

* fix after review

---------

Signed-off-by: pingjiang <[email protected]>
Co-authored-by: pingjiang <[email protected]>
  • Loading branch information
knative-prow-robot and xiangpingjiang authored Dec 18, 2023
1 parent d713c4d commit e50ad59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/broker/ingress/ingress_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve

brokerInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
broker, ok := obj.(eventingv1.Broker)
if !ok {
broker, ok := obj.(*eventingv1.Broker)
if !ok || broker == nil || broker.Status.Address == nil {
return
}
kncloudevents.AddOrUpdateAddressableHandler(duckv1.Addressable{
Expand All @@ -87,8 +87,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve
})
},
UpdateFunc: func(_, obj interface{}) {
broker, ok := obj.(eventingv1.Broker)
if !ok {
broker, ok := obj.(*eventingv1.Broker)
if !ok || broker == nil || broker.Status.Address == nil {
return
}
kncloudevents.AddOrUpdateAddressableHandler(duckv1.Addressable{
Expand All @@ -97,8 +97,8 @@ func NewHandler(logger *zap.Logger, reporter StatsReporter, defaulter client.Eve
})
},
DeleteFunc: func(obj interface{}) {
broker, ok := obj.(eventingv1.Broker)
if !ok {
broker, ok := obj.(*eventingv1.Broker)
if !ok || broker == nil || broker.Status.Address == nil {
return
}
kncloudevents.DeleteAddressableHandler(duckv1.Addressable{
Expand Down

0 comments on commit e50ad59

Please sign in to comment.