Skip to content

Commit

Permalink
Merge pull request #2212 from zwtop/set_DeleteStateUnknown
Browse files Browse the repository at this point in the history
🐛 Set DeleteStateUnknown when obj is DeletedFinalStateUnknown
  • Loading branch information
k8s-ci-robot committed Mar 1, 2023
2 parents f6f37e6 + de8e46e commit 69e67af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/internal/source/event_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ func (e *EventHandler) OnDelete(obj interface{}) {
return
}

// Set DeleteStateUnknown to true
d.DeleteStateUnknown = true

// Set obj to the tombstone obj
obj = tombstone.Obj
}
Expand Down
1 change: 1 addition & 0 deletions pkg/internal/source/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ var _ = Describe("Internal", func() {
funcs.DeleteFunc = func(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface) {
defer GinkgoRecover()
Expect(evt.Object).To(Equal(pod))
Expect(evt.DeleteStateUnknown).Should(BeTrue())
}

instance.OnDelete(tombstone)
Expand Down

0 comments on commit 69e67af

Please sign in to comment.