Skip to content

Commit

Permalink
Merge pull request #253 from limhawjia/fix-deleted-final-state-unknown
Browse files Browse the repository at this point in the history
fix(core): incorrect type assertion to *cache.DeletedFinalStateUnknown
  • Loading branch information
limhawjia authored Oct 26, 2023
2 parents 94f1d20 + ebc57c5 commit b21eb4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/federate/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/informermanager/federatedinformermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b21eb4f

Please sign in to comment.