File tree 1 file changed +8
-0
lines changed
operator-framework/src/main/java/com/github/containersolutions/operator/processing
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) {
75
75
log .debug ("Scheduling event: {}" , event );
76
76
try {
77
77
lock .lock ();
78
+ if (event .getResource ().getMetadata ().getDeletionTimestamp () != null && event .getAction () == Action .DELETED ) {
79
+ // Note 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 locking 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
+ }
78
86
if (eventStore .receivedMoreRecentEventBefore (event )) {
79
87
log .debug ("Skipping event processing since was processed event with newer version before. {}" , event );
80
88
return ;
You can’t perform that action at this time.
0 commit comments