Skip to content

Commit

Permalink
Merge pull request #75 from jellor/delete-gateway
Browse files Browse the repository at this point in the history
handle DeletedFinalStateUnknown in deleteGateway
  • Loading branch information
njucjc authored Nov 14, 2022
2 parents 12398c3 + f69371b commit f9ad2fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/k8s/engine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,19 @@ func (c *EngineController) updateGateway(oldObj interface{}, newObj interface{})
}

func (c *EngineController) deleteGateway(obj interface{}) {
gw := obj.(*v1alpha1.Gateway)
gw, ok := obj.(*v1alpha1.Gateway)
if !ok {
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
klog.Errorf("couldn't get object from tombstone %#v", obj)
return
}
gw, ok = tombstone.Obj.(*v1alpha1.Gateway)
if !ok {
klog.Errorf("tombstone contained object that is not a Gateway %#v", obj)
return
}
}
klog.InfoS("deleting gateway", "gateway", klog.KObj(gw))
c.enqueue(gw)
}

0 comments on commit f9ad2fa

Please sign in to comment.