diff --git a/control-plane/pkg/reconciler/consumer/controller.go b/control-plane/pkg/reconciler/consumer/controller.go index 164e8cbdc6..539a09503a 100644 --- a/control-plane/pkg/reconciler/consumer/controller.go +++ b/control-plane/pkg/reconciler/consumer/controller.go @@ -97,14 +97,9 @@ func NewController(ctx context.Context, watcher configmap.Watcher) *controller.I return nil, false } - for _, ref := range c.GetOwnerReferences() { - if ref.Kind == "ConsumerGroup" { - cg, err := r.ConsumerGroupLister.ConsumerGroups(c.GetNamespace()).Get(ref.Name) - return cg, err == nil - } - } - - return nil, false + cgRef := c.GetConsumerGroup() + cg, err := r.ConsumerGroupLister.ConsumerGroups(c.GetNamespace()).Get(cgRef.Name) + return cg, err == nil }) trustBundleConfigMapInformer.Informer().AddEventHandler(controller.HandleAll(globalResync)) diff --git a/control-plane/pkg/reconciler/consumergroup/controller.go b/control-plane/pkg/reconciler/consumergroup/controller.go index eb39eb77ef..74b73cf04b 100644 --- a/control-plane/pkg/reconciler/consumergroup/controller.go +++ b/control-plane/pkg/reconciler/consumergroup/controller.go @@ -220,7 +220,7 @@ func ResyncOnStatefulSetChange(ctx context.Context, filteredResync func(f func(i return false } for _, owner := range cg.OwnerReferences { - if owner.Kind == kind { + if strings.EqualFold(owner.Kind, kind) { return true } }