File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
operator-framework/src/main/java/com/github/containersolutions/operator/processing Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ void scheduleEvent(CustomResourceEvent event) {
7575 log .debug ("Scheduling event: {}" , event );
7676 try {
7777 lock .lock ();
78+ if (event .getResource ().getMetadata ().getDeletionTimestamp () != null && event .getAction () == Action .DELETED ) {
79+ // Not that we always use finalizers, we want to process delete event just in corner case,
80+ // when we are not able to add finalizer (lets say because of optimistic error, and the resource was deleted instantly).
81+ // We want to skip in case of finalizer was there since we don't want to execute delete method always at least 2x,
82+ // which would be the result if we don't skip here. (If there is no deletion timestamp if resource deleted without finalizer.
83+ log .debug ("Skipping delete event since deletion timestamp is present on resource, so finalizer was in place." );
84+ return ;
85+ }
7886 if (eventStore .receivedMoreRecentEventBefore (event )) {
7987 log .debug ("Skipping event processing since was processed event with newer version before. {}" , event );
8088 return ;
You can’t perform that action at this time.
0 commit comments