File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
internal/ingress/controller/store Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -817,7 +817,17 @@ func New(
817817 DeleteFunc : func (obj interface {}) {
818818 svc , ok := obj .(* corev1.Service )
819819 if ! ok {
820- klog .Errorf ("unexpected type: %T" , obj )
820+ // If we reached here it means the service was deleted but its final state is unrecorded.
821+ tombstone , ok := obj .(cache.DeletedFinalStateUnknown )
822+ if ! ok {
823+ klog .ErrorS (nil , "Error obtaining object from tombstone" , "key" , obj )
824+ return
825+ }
826+ svc , ok = tombstone .Obj .(* corev1.Service )
827+ if ! ok {
828+ klog .Errorf ("Tombstone contained object that is not a Service: %#v" , obj )
829+ return
830+ }
821831 }
822832 if svc .Spec .Type == corev1 .ServiceTypeExternalName {
823833 updateCh .In () <- Event {
You can’t perform that action at this time.
0 commit comments