Skip to content

Commit 69e67af

Browse files
authored
Merge pull request #2212 from zwtop/set_DeleteStateUnknown
🐛 Set DeleteStateUnknown when obj is DeletedFinalStateUnknown
2 parents f6f37e6 + de8e46e commit 69e67af

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/internal/source/event_handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ func (e *EventHandler) OnDelete(obj interface{}) {
133133
return
134134
}
135135

136+
// Set DeleteStateUnknown to true
137+
d.DeleteStateUnknown = true
138+
136139
// Set obj to the tombstone obj
137140
obj = tombstone.Obj
138141
}

pkg/internal/source/internal_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ var _ = Describe("Internal", func() {
269269
funcs.DeleteFunc = func(ctx context.Context, evt event.DeleteEvent, q workqueue.RateLimitingInterface) {
270270
defer GinkgoRecover()
271271
Expect(evt.Object).To(Equal(pod))
272+
Expect(evt.DeleteStateUnknown).Should(BeTrue())
272273
}
273274

274275
instance.OnDelete(tombstone)

0 commit comments

Comments
 (0)