@@ -130,9 +130,9 @@ var _ = Describe("remove_process_groups", func() {
130
130
It ("should not remove that process group" , func () {
131
131
Expect (result ).To (BeNil ())
132
132
// Ensure resources are not deleted
133
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
134
- Expect (err ).To (BeNil ())
135
- Expect (removed ) .To (BeFalse ())
133
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
134
+ Expect (err ).NotTo (BeNil ())
135
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
136
136
Expect (include ).To (BeFalse ())
137
137
})
138
138
})
@@ -149,9 +149,8 @@ var _ = Describe("remove_process_groups", func() {
149
149
It ("should successfully remove that process group" , func () {
150
150
Expect (result ).To (BeNil ())
151
151
// Ensure resources are deleted
152
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
152
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
153
153
Expect (err ).To (BeNil ())
154
- Expect (removed ).To (BeTrue ())
155
154
Expect (include ).To (BeTrue ())
156
155
})
157
156
})
@@ -161,9 +160,8 @@ var _ = Describe("remove_process_groups", func() {
161
160
It ("should successfully remove that process group" , func () {
162
161
Expect (result ).To (BeNil ())
163
162
// Ensure resources are deleted
164
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
163
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
165
164
Expect (err ).To (BeNil ())
166
- Expect (removed ).To (BeTrue ())
167
165
Expect (include ).To (BeTrue ())
168
166
})
169
167
})
@@ -187,9 +185,9 @@ var _ = Describe("remove_process_groups", func() {
187
185
Expect (result ).NotTo (BeNil ())
188
186
Expect (result .message ).To (Equal ("Removals cannot proceed because cluster has degraded fault tolerance" ))
189
187
// Ensure resources are not deleted
190
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
191
- Expect (err ).To (BeNil ())
192
- Expect (removed ) .To (BeFalse ())
188
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
189
+ Expect (err ).NotTo (BeNil ())
190
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
193
191
Expect (include ).To (BeFalse ())
194
192
})
195
193
})
@@ -211,9 +209,9 @@ var _ = Describe("remove_process_groups", func() {
211
209
Expect (result ).NotTo (BeNil ())
212
210
Expect (result .message ).To (Equal ("Removals cannot proceed because cluster has degraded fault tolerance" ))
213
211
// Ensure resources are not deleted
214
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
215
- Expect (err ).To (BeNil ())
216
- Expect (removed ) .To (BeFalse ())
212
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
213
+ Expect (err ).NotTo (BeNil ())
214
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
217
215
Expect (include ).To (BeFalse ())
218
216
})
219
217
})
@@ -235,9 +233,9 @@ var _ = Describe("remove_process_groups", func() {
235
233
Expect (result ).NotTo (BeNil ())
236
234
Expect (result .curError ).To (HaveOccurred ())
237
235
// Ensure resources are not deleted
238
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
239
- Expect (err ).To (BeNil ())
240
- Expect (removed ) .To (BeFalse ())
236
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
237
+ Expect (err ).NotTo (BeNil ())
238
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
241
239
Expect (include ).To (BeFalse ())
242
240
})
243
241
})
@@ -267,9 +265,8 @@ var _ = Describe("remove_process_groups", func() {
267
265
It ("should successfully remove that process group" , func () {
268
266
Expect (result ).To (BeNil ())
269
267
// Ensure resources are deleted
270
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
268
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
271
269
Expect (err ).To (BeNil ())
272
- Expect (removed ).To (BeTrue ())
273
270
Expect (include ).To (BeTrue ())
274
271
})
275
272
})
@@ -291,9 +288,9 @@ var _ = Describe("remove_process_groups", func() {
291
288
Expect (result ).NotTo (BeNil ())
292
289
Expect (result .message ).To (Equal ("Removals cannot proceed because cluster has degraded fault tolerance" ))
293
290
// Ensure resources are not deleted
294
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
295
- Expect (err ).To (BeNil ())
296
- Expect (removed ) .To (BeFalse ())
291
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
292
+ Expect (err ).NotTo (BeNil ())
293
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
297
294
Expect (include ).To (BeFalse ())
298
295
})
299
296
})
@@ -323,13 +320,11 @@ var _ = Describe("remove_process_groups", func() {
323
320
Expect (result ).To (BeNil ())
324
321
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 1 ))
325
322
// Check if resources are deleted
326
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
327
- Expect (err ).To (BeNil ())
323
+ include , errFirst := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
328
324
// Check if resources are deleted
329
- removedSecondary , includeSecondary , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
330
- Expect (err ).To (BeNil ())
325
+ includeSecondary , errSecond := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
331
326
// Make sure only one of the process groups was deleted.
332
- Expect (removed ).NotTo (Equal (removedSecondary ))
327
+ Expect (errFirst ).NotTo (Equal (errSecond ))
333
328
Expect (include ).NotTo (Equal (includeSecondary ))
334
329
})
335
330
@@ -343,14 +338,12 @@ var _ = Describe("remove_process_groups", func() {
343
338
Expect (result ).To (BeNil ())
344
339
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
345
340
// Ensure resources are deleted
346
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
341
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
347
342
Expect (err ).To (BeNil ())
348
- Expect (removed ).To (BeTrue ())
349
343
Expect (include ).To (BeTrue ())
350
344
// Ensure resources are deleted
351
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
345
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
352
346
Expect (err ).To (BeNil ())
353
- Expect (removed ).To (BeTrue ())
354
347
Expect (include ).To (BeTrue ())
355
348
})
356
349
})
@@ -364,14 +357,12 @@ var _ = Describe("remove_process_groups", func() {
364
357
Expect (result ).To (BeNil ())
365
358
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
366
359
// Ensure resources are deleted
367
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
360
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
368
361
Expect (err ).To (BeNil ())
369
- Expect (removed ).To (BeTrue ())
370
362
Expect (include ).To (BeTrue ())
371
363
// Ensure resources are deleted
372
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
364
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
373
365
Expect (err ).To (BeNil ())
374
- Expect (removed ).To (BeTrue ())
375
366
Expect (include ).To (BeTrue ())
376
367
})
377
368
})
@@ -388,14 +379,14 @@ var _ = Describe("remove_process_groups", func() {
388
379
Expect (result .message ).To (HavePrefix ("not allowed to remove process groups, waiting:" ))
389
380
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 0 ))
390
381
// Ensure resources are not deleted
391
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
392
- Expect (err ).To (BeNil ())
393
- Expect (removed ) .To (BeFalse ())
382
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
383
+ Expect (err ).NotTo (BeNil ())
384
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
394
385
Expect (include ).To (BeFalse ())
395
- // Ensure resources are deleted
396
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
397
- Expect (err ).To (BeNil ())
398
- Expect (removed ) .To (BeFalse ())
386
+ // Ensure resources are not deleted
387
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
388
+ Expect (err ).NotTo (BeNil ())
389
+ Expect (internal . IsResourceNotDeleted ( err )) .To (BeTrue ())
399
390
Expect (include ).To (BeFalse ())
400
391
})
401
392
})
@@ -425,14 +416,12 @@ var _ = Describe("remove_process_groups", func() {
425
416
Expect (result ).To (BeNil ())
426
417
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
427
418
// Ensure resources are deleted
428
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
419
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
429
420
Expect (err ).To (BeNil ())
430
- Expect (removed ).To (BeTrue ())
431
421
Expect (include ).To (BeTrue ())
432
422
// Ensure resources are deleted as the RemovalMode is PodUpdateModeAll
433
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
423
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
434
424
Expect (err ).To (BeNil ())
435
- Expect (removed ).To (BeTrue ())
436
425
Expect (include ).To (BeTrue ())
437
426
})
438
427
@@ -446,14 +435,12 @@ var _ = Describe("remove_process_groups", func() {
446
435
Expect (result ).To (BeNil ())
447
436
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
448
437
// Ensure resources are deleted
449
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
438
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
450
439
Expect (err ).To (BeNil ())
451
- Expect (removed ).To (BeTrue ())
452
440
Expect (include ).To (BeTrue ())
453
441
// Ensure resources are deleted
454
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
442
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
455
443
Expect (err ).To (BeNil ())
456
- Expect (removed ).To (BeTrue ())
457
444
Expect (include ).To (BeTrue ())
458
445
})
459
446
})
@@ -467,14 +454,12 @@ var _ = Describe("remove_process_groups", func() {
467
454
Expect (result ).To (BeNil ())
468
455
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
469
456
// Ensure resources are deleted
470
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
457
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
471
458
Expect (err ).To (BeNil ())
472
- Expect (removed ).To (BeTrue ())
473
459
Expect (include ).To (BeTrue ())
474
460
// Ensure resources are deleted
475
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
461
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
476
462
Expect (err ).To (BeNil ())
477
- Expect (removed ).To (BeTrue ())
478
463
Expect (include ).To (BeTrue ())
479
464
})
480
465
})
@@ -490,14 +475,12 @@ var _ = Describe("remove_process_groups", func() {
490
475
Expect (result ).To (BeNil ())
491
476
Expect (initialCnt - len (cluster .Status .ProcessGroups )).To (BeNumerically ("==" , 2 ))
492
477
// Ensure resources are not deleted
493
- removed , include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
478
+ include , err := confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , removedProcessGroup )
494
479
Expect (err ).To (BeNil ())
495
- Expect (removed ).To (BeTrue ())
496
480
Expect (include ).To (BeTrue ())
497
481
// Ensure resources are deleted
498
- removed , include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
482
+ include , err = confirmRemoval (context .Background (), globalControllerLogger , clusterReconciler , cluster , secondRemovedProcessGroup )
499
483
Expect (err ).To (BeNil ())
500
- Expect (removed ).To (BeTrue ())
501
484
Expect (include ).To (BeTrue ())
502
485
})
503
486
})
0 commit comments