@@ -197,7 +197,7 @@ void removesDefaultFinalizerOnDeleteIfSet() {
197
197
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
198
198
199
199
assertThat (postExecControl .isFinalizerRemoved ()).isTrue ();
200
- verify (customResourceFacade , times (1 )).patchResource (eq (testCustomResource ), any ());
200
+ verify (customResourceFacade , times (1 )).patchResourceWithoutSSA (eq (testCustomResource ), any ());
201
201
}
202
202
203
203
@ Test
@@ -206,7 +206,7 @@ void retriesFinalizerRemovalWithFreshResource() {
206
206
markForDeletion (testCustomResource );
207
207
var resourceWithFinalizer = TestUtils .testCustomResource ();
208
208
resourceWithFinalizer .addFinalizer (DEFAULT_FINALIZER );
209
- when (customResourceFacade .patchResource (eq (testCustomResource ), any ()))
209
+ when (customResourceFacade .patchResourceWithoutSSA (eq (testCustomResource ), any ()))
210
210
.thenThrow (new KubernetesClientException (null , 409 , null ))
211
211
.thenReturn (testCustomResource );
212
212
when (customResourceFacade .getResource (any (), any ())).thenReturn (resourceWithFinalizer );
@@ -215,7 +215,7 @@ void retriesFinalizerRemovalWithFreshResource() {
215
215
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
216
216
217
217
assertThat (postExecControl .isFinalizerRemoved ()).isTrue ();
218
- verify (customResourceFacade , times (2 )).patchResource (any (), any ());
218
+ verify (customResourceFacade , times (2 )).patchResourceWithoutSSA (any (), any ());
219
219
verify (customResourceFacade , times (1 )).getResource (any (), any ());
220
220
}
221
221
@@ -225,23 +225,23 @@ void nullResourceIsGracefullyHandledOnFinalizerRemovalRetry() {
225
225
// of the finalizer removal
226
226
testCustomResource .addFinalizer (DEFAULT_FINALIZER );
227
227
markForDeletion (testCustomResource );
228
- when (customResourceFacade .patchResource (any (), any ()))
228
+ when (customResourceFacade .patchResourceWithoutSSA (any (), any ()))
229
229
.thenThrow (new KubernetesClientException (null , 409 , null ));
230
230
when (customResourceFacade .getResource (any (), any ())).thenReturn (null );
231
231
232
232
var postExecControl =
233
233
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
234
234
235
235
assertThat (postExecControl .isFinalizerRemoved ()).isTrue ();
236
- verify (customResourceFacade , times (1 )).patchResource (eq (testCustomResource ), any ());
236
+ verify (customResourceFacade , times (1 )).patchResourceWithoutSSA (eq (testCustomResource ), any ());
237
237
verify (customResourceFacade , times (1 )).getResource (any (), any ());
238
238
}
239
239
240
240
@ Test
241
241
void throwsExceptionIfFinalizerRemovalRetryExceeded () {
242
242
testCustomResource .addFinalizer (DEFAULT_FINALIZER );
243
243
markForDeletion (testCustomResource );
244
- when (customResourceFacade .patchResource (any (), any ()))
244
+ when (customResourceFacade .patchResourceWithoutSSA (any (), any ()))
245
245
.thenThrow (new KubernetesClientException (null , 409 , null ));
246
246
when (customResourceFacade .getResource (any (), any ()))
247
247
.thenAnswer ((Answer <TestCustomResource >) invocationOnMock -> createResourceWithFinalizer ());
@@ -253,7 +253,7 @@ void throwsExceptionIfFinalizerRemovalRetryExceeded() {
253
253
assertThat (postExecControl .getRuntimeException ()).isPresent ();
254
254
assertThat (postExecControl .getRuntimeException ().get ())
255
255
.isInstanceOf (OperatorException .class );
256
- verify (customResourceFacade , times (MAX_UPDATE_RETRY )).patchResource (any (), any ());
256
+ verify (customResourceFacade , times (MAX_UPDATE_RETRY )).patchResourceWithoutSSA (any (), any ());
257
257
verify (customResourceFacade , times (MAX_UPDATE_RETRY - 1 )).getResource (any (),
258
258
any ());
259
259
}
@@ -262,15 +262,15 @@ void throwsExceptionIfFinalizerRemovalRetryExceeded() {
262
262
void throwsExceptionIfFinalizerRemovalClientExceptionIsNotConflict () {
263
263
testCustomResource .addFinalizer (DEFAULT_FINALIZER );
264
264
markForDeletion (testCustomResource );
265
- when (customResourceFacade .patchResource (any (), any ()))
265
+ when (customResourceFacade .patchResourceWithoutSSA (any (), any ()))
266
266
.thenThrow (new KubernetesClientException (null , 400 , null ));
267
267
268
268
var res =
269
269
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
270
270
271
271
assertThat (res .getRuntimeException ()).isPresent ();
272
272
assertThat (res .getRuntimeException ().get ()).isInstanceOf (KubernetesClientException .class );
273
- verify (customResourceFacade , times (1 )).patchResource (any (), any ());
273
+ verify (customResourceFacade , times (1 )).patchResourceWithoutSSA (any (), any ());
274
274
verify (customResourceFacade , never ()).getResource (any (), any ());
275
275
}
276
276
0 commit comments