From ebc57c58b0d8c96f7473e2944c811e68f9c53055 Mon Sep 17 00:00:00 2001 From: "hawjia.lim" Date: Thu, 26 Oct 2023 14:08:45 +0800 Subject: [PATCH] fix(core): incorrect cast to DeleteFinalStateUnknown --- pkg/controllers/federate/controller.go | 4 ++-- pkg/util/informermanager/federatedinformermanager.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controllers/federate/controller.go b/pkg/controllers/federate/controller.go index 570edf57..afaf30b8 100644 --- a/pkg/controllers/federate/controller.go +++ b/pkg/controllers/federate/controller.go @@ -125,7 +125,7 @@ func NewFederateController( Generator: func(ftc *fedcorev1a1.FederatedTypeConfig) cache.ResourceEventHandler { return cache.FilteringResourceEventHandler{ FilterFunc: func(obj interface{}) bool { - if deleted, ok := obj.(*cache.DeletedFinalStateUnknown); ok { + if deleted, ok := obj.(cache.DeletedFinalStateUnknown); ok { obj = deleted.Obj } uns := obj.(*unstructured.Unstructured) @@ -148,7 +148,7 @@ func NewFederateController( if _, err := fedObjectInformer.Informer().AddEventHandler(cache.FilteringResourceEventHandler{ FilterFunc: func(obj interface{}) bool { - if deleted, ok := obj.(*cache.DeletedFinalStateUnknown); ok { + if deleted, ok := obj.(cache.DeletedFinalStateUnknown); ok { obj = deleted.Obj } fedObj := obj.(*fedcorev1a1.FederatedObject) diff --git a/pkg/util/informermanager/federatedinformermanager.go b/pkg/util/informermanager/federatedinformermanager.go index 73061f80..fad20582 100644 --- a/pkg/util/informermanager/federatedinformermanager.go +++ b/pkg/util/informermanager/federatedinformermanager.go @@ -510,7 +510,7 @@ func (m *federatedInformerManager) Start(ctx context.Context) { } }, DeleteFunc: func(obj interface{}) { - if deleted, ok := obj.(*cache.DeletedFinalStateUnknown); ok { + if deleted, ok := obj.(cache.DeletedFinalStateUnknown); ok { obj = deleted.Obj if obj == nil { return