Skip to content

Commit

Permalink
Sink: Don't forward for deletion marked entities
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jul 7, 2023
1 parent 19a0b4a commit e01e625
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/sync/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func (s *Sink) ErrorCh() <-chan error {
}

func (s *Sink) Upsert(ctx context.Context, item *Item) error {
if !item.Item.GetDeletionTimestamp().IsZero() {
// K8s might dispatch an update event for an object that is already marked for
// deletion due to its sub-resources being deleted/modified. However, neither event
// matters to us as their parent object is going to be deleted soon.
return nil
}

select {
case s.upsert <- s.upsertFunc(item):
return nil
Expand Down

0 comments on commit e01e625

Please sign in to comment.