Skip to content

Commit 28e979d

Browse files
committed
test fix:
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent a4ab368 commit 28e979d

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,16 +510,15 @@ default boolean useSSAToPatchPrimaryResource() {
510510
* either use simple patches or SSA. Setting this to {@code true}, controllers will use SSA for
511511
* adding finalizers, patching resources and status.
512512
*
513-
* @return {@code true} if Server-Side Apply (SSA) should be used when managing finalizers,
514-
* {@code false} otherwise
513+
* @return {@code true} if Server-Side Apply (SSA) should be used when managing finalizers, {@code
514+
* false} otherwise
515515
* @see ConfigurationServiceOverrider#withUseSSAToManageFinalizer(boolean)
516516
* @since 5.1.2
517517
*/
518518
default boolean useSSAToManageFinalizer() {
519519
return true;
520520
}
521521

522-
523522
/**
524523
* Determines whether resources retrieved from caches such as via calls to {@link
525524
* Context#getSecondaryResource(Class)} should be defensively cloned first.

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public boolean useSSAToPatchPrimaryResource() {
345345
@Override
346346
public boolean useSSAToManageFinalizer() {
347347
return overriddenValueOrDefault(
348-
useSSAToManageFinalizer, ConfigurationService::useSSAToPatchPrimaryResource);
348+
useSSAToManageFinalizer, ConfigurationService::useSSAToPatchPrimaryResource);
349349
}
350350

351351
@Override

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,18 @@ class ReconciliationDispatcherTest {
6262

6363
@BeforeEach
6464
void setup() {
65-
initConfigService(true);
65+
initConfigService(true, true);
6666
testCustomResource = TestUtils.testCustomResource();
6767
reconciler = spy(new TestReconciler());
6868
reconciliationDispatcher =
6969
init(testCustomResource, reconciler, null, customResourceFacade, true);
7070
}
7171

72-
static void initConfigService(boolean useSSA) {
73-
initConfigService(useSSA, true);
72+
static void initConfigService(boolean useSSA, boolean useSSAForFinalizer) {
73+
initConfigService(useSSA, useSSAForFinalizer, true);
7474
}
7575

76-
static void initConfigService(boolean useSSA, boolean noCloning) {
76+
static void initConfigService(boolean useSSA, boolean useSSAForFinalizer, boolean noCloning) {
7777
/*
7878
* We need this for mock reconcilers to properly generate the expected UpdateControl: without
7979
* this, calls such as `when(reconciler.reconcile(eq(testCustomResource),
@@ -98,7 +98,8 @@ public <R extends HasMetadata> R clone(R object) {
9898
}
9999
}
100100
})
101-
.withUseSSAToPatchPrimaryResource(useSSA));
101+
.withUseSSAToPatchPrimaryResource(useSSA)
102+
.withUseSSAToManageFinalizer(useSSAForFinalizer));
102103
}
103104

104105
private <R extends HasMetadata> ReconciliationDispatcher<R> init(
@@ -149,7 +150,7 @@ void addFinalizerOnNewResource() {
149150

150151
@Test
151152
void addFinalizerOnNewResourceWithoutSSA() {
152-
initConfigService(false);
153+
initConfigService(false, false);
153154
final ReconciliationDispatcher<TestCustomResource> dispatcher =
154155
init(testCustomResource, reconciler, null, customResourceFacade, true);
155156

@@ -640,7 +641,7 @@ void canSkipSchedulingMaxDelayIf() {
640641

641642
@Test
642643
void retriesAddingFinalizerWithoutSSA() {
643-
initConfigService(false);
644+
initConfigService(true, false);
644645
reconciliationDispatcher =
645646
init(testCustomResource, reconciler, null, customResourceFacade, true);
646647

@@ -683,7 +684,7 @@ void reSchedulesFromErrorHandler() {
683684

684685
@Test
685686
void reconcilerContextUsesTheSameInstanceOfResourceAsParam() {
686-
initConfigService(false, false);
687+
initConfigService(false, false, false);
687688

688689
final ReconciliationDispatcher<TestCustomResource> dispatcher =
689690
init(testCustomResource, reconciler, null, customResourceFacade, true);

0 commit comments

Comments
 (0)