@@ -86,7 +86,7 @@ private PostExecutionControl<P> handleDispatch(ExecutionScope<P> executionScope)
86
86
}
87
87
88
88
Context <P > context =
89
- new DefaultContext <>(executionScope .getRetryInfo (), controller , originalResource );
89
+ new DefaultContext <>(executionScope .getRetryInfo (), controller , resourceForExecution );
90
90
if (markedForDeletion ) {
91
91
return handleCleanup (resourceForExecution , originalResource , context );
92
92
} else {
@@ -234,29 +234,29 @@ private void updatePostExecutionControlWithReschedule(
234
234
baseControl .getScheduleDelay ().ifPresent (postExecutionControl ::withReSchedule );
235
235
}
236
236
237
- private PostExecutionControl <P > handleCleanup (P resource ,
237
+ private PostExecutionControl <P > handleCleanup (P resourceForExecution ,
238
238
P originalResource , Context <P > context ) {
239
239
if (log .isDebugEnabled ()) {
240
240
log .debug (
241
241
"Executing delete for resource: {} with version: {}" ,
242
- ResourceID .fromResource (resource ),
243
- getVersion (resource ));
242
+ ResourceID .fromResource (resourceForExecution ),
243
+ getVersion (resourceForExecution ));
244
244
}
245
- DeleteControl deleteControl = controller .cleanup (resource , context );
245
+ DeleteControl deleteControl = controller .cleanup (resourceForExecution , context );
246
246
final var useFinalizer = controller .useFinalizer ();
247
247
if (useFinalizer ) {
248
248
// note that we don't reschedule here even if instructed. Removing finalizer means that
249
- // cleanup is finished, nothing left to done
249
+ // cleanup is finished, nothing left to be done
250
250
final var finalizerName = configuration ().getFinalizerName ();
251
- if (deleteControl .isRemoveFinalizer () && resource .hasFinalizer (finalizerName )) {
252
- P customResource = conflictRetryingPatch (resource , originalResource , r -> {
251
+ if (deleteControl .isRemoveFinalizer () && resourceForExecution .hasFinalizer (finalizerName )) {
252
+ P customResource = conflictRetryingPatch (resourceForExecution , originalResource , r -> {
253
253
// the operator might not be allowed to retrieve the resource on a retry, e.g. when its
254
254
// permissions are removed by deleting the namespace concurrently
255
255
if (r == null ) {
256
256
log .warn (
257
257
"Could not remove finalizer on null resource: {} with version: {}" ,
258
- getUID (resource ),
259
- getVersion (resource ));
258
+ getUID (resourceForExecution ),
259
+ getVersion (resourceForExecution ));
260
260
return false ;
261
261
}
262
262
return r .removeFinalizer (finalizerName );
@@ -266,8 +266,8 @@ private PostExecutionControl<P> handleCleanup(P resource,
266
266
}
267
267
log .debug (
268
268
"Skipping finalizer remove for resource: {} with version: {}. delete control: {}, uses finalizer: {}" ,
269
- getUID (resource ),
270
- getVersion (resource ),
269
+ getUID (resourceForExecution ),
270
+ getVersion (resourceForExecution ),
271
271
deleteControl ,
272
272
useFinalizer );
273
273
PostExecutionControl <P > postExecutionControl = PostExecutionControl .defaultDispatch ();
0 commit comments