Skip to content

Commit

Permalink
Merge pull request #4614 from kyrtapz/eps_mirror_handle_tombstone
Browse files Browse the repository at this point in the history
EndpointSlice mirror controller: handle tombstone deletion
  • Loading branch information
trozet authored Aug 14, 2024
2 parents 9030c8a + 0e05804 commit afe2d22
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ func (c *Controller) getDefaultEndpointSliceKey(endpointSlice *v1.EndpointSlice)
func (c *Controller) enqueueEndpointSlice(obj interface{}) {
eps, ok := obj.(*v1.EndpointSlice)
if !ok {
klog.Errorf("Enqueued non-endpointSlice object %+v, skipping", obj)
return
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
utilruntime.HandleError(fmt.Errorf("passed object is neither an EndpointSlice nor a DeletedFinalStateUnknown type: %#v", obj))
return
}
eps, ok = tombstone.Obj.(*v1.EndpointSlice)
if !ok {
utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a EndpointSlice: %#v", obj))
return
}
}
if key := c.getDefaultEndpointSliceKey(eps); key != "" {
c.queue.AddRateLimited(key)
Expand Down

0 comments on commit afe2d22

Please sign in to comment.