@@ -53,7 +53,7 @@ private PostExecutionControl handDispatch(ExecutionScope executionScope) {
53
53
cleanup (executionScope .getCustomResource ());
54
54
return PostExecutionControl .defaultDispatch ();
55
55
}
56
- if ((markedForDeletion (resource ) && !ControllerUtils .hasDefaultFinalizer (resource , resourceDefaultFinalizer ))) {
56
+ if ((markedForDeletion (resource ) && !ControllerUtils .hasGivenFinalizer (resource , resourceDefaultFinalizer ))) {
57
57
log .debug ("Skipping event dispatching since its marked for deletion but has no default finalizer: {}" , executionScope );
58
58
return PostExecutionControl .defaultDispatch ();
59
59
}
@@ -66,7 +66,7 @@ private PostExecutionControl handDispatch(ExecutionScope executionScope) {
66
66
}
67
67
68
68
private PostExecutionControl handleCreateOrUpdate (ExecutionScope executionScope , CustomResource resource , Context context ) {
69
- if (!ControllerUtils .hasDefaultFinalizer (resource , resourceDefaultFinalizer ) && !markedForDeletion (resource )) {
69
+ if (!ControllerUtils .hasGivenFinalizer (resource , resourceDefaultFinalizer ) && !markedForDeletion (resource )) {
70
70
/* We always add the default finalizer if missing and not marked for deletion.
71
71
We execute the controller processing only for processing the event sent as a results
72
72
of the finalizer add. This will make sure that the resources are not created before
@@ -101,7 +101,7 @@ private boolean skipBecauseOfGenerations(ExecutionScope executionScope) {
101
101
102
102
private PostExecutionControl handleDelete (CustomResource resource , Context context ) {
103
103
DeleteControl deleteControl = controller .deleteResource (resource , context );
104
- boolean hasDefaultFinalizer = ControllerUtils .hasDefaultFinalizer (resource , resourceDefaultFinalizer );
104
+ boolean hasDefaultFinalizer = ControllerUtils .hasGivenFinalizer (resource , resourceDefaultFinalizer );
105
105
if (deleteControl .getRemoveFinalizer () && hasDefaultFinalizer ) {
106
106
removeDefaultFinalizer (resource );
107
107
cleanup (resource );
@@ -160,7 +160,7 @@ private void replace(CustomResource resource) {
160
160
}
161
161
162
162
private void addFinalizerIfNotPresent (CustomResource resource ) {
163
- if (!ControllerUtils .hasDefaultFinalizer (resource , resourceDefaultFinalizer ) && !markedForDeletion (resource )) {
163
+ if (!ControllerUtils .hasGivenFinalizer (resource , resourceDefaultFinalizer ) && !markedForDeletion (resource )) {
164
164
log .info ("Adding default finalizer to {}" , resource .getMetadata ());
165
165
if (resource .getMetadata ().getFinalizers () == null ) {
166
166
resource .getMetadata ().setFinalizers (new ArrayList <>(1 ));
0 commit comments