Skip to content

Commit d4df638

Browse files
authored
fix: set default CRD check to false (#1057)
1 parent c9c7016 commit d4df638

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ default Config getClientConfiguration() {
7575
* @return {@code true} if CRDs should be checked (default), {@code false} otherwise
7676
*/
7777
default boolean checkCRDAndValidateLocalModel() {
78-
return true;
78+
return false;
7979
}
8080

8181
int DEFAULT_RECONCILIATION_THREADS_NUMBER = 5;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static boolean isValidateCustomResourcesEnvVarSet() {
6161
}
6262

6363
public static boolean shouldCheckCRDAndValidateLocalModel() {
64-
return getBooleanFromSystemPropsOrDefault(CHECK_CRD_ENV_KEY, true);
64+
return getBooleanFromSystemPropsOrDefault(CHECK_CRD_ENV_KEY, false);
6565
}
6666

6767
public static boolean debugThreadPool() {

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/UtilsTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class UtilsTest {
88

99
@Test
1010
void shouldCheckCRDAndValidateLocalModelByDefault() {
11-
assertTrue(Utils.shouldCheckCRDAndValidateLocalModel());
11+
assertFalse(Utils.shouldCheckCRDAndValidateLocalModel());
1212
}
1313

1414
@Test

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ void crdShouldNotBeCheckedForCustomResourcesIfDisabled() {
5454
}
5555

5656
@Test
57-
void crdShouldBeCheckedForCustomResourcesByDefault() {
57+
void crdCanBeCheckedForCustomResources() {
5858
final var client = mock(KubernetesClient.class);
5959
final var configurationService = mock(ConfigurationService.class);
60-
when(configurationService.checkCRDAndValidateLocalModel()).thenCallRealMethod();
60+
when(configurationService.checkCRDAndValidateLocalModel()).thenReturn(true);
6161
final var reconciler = mock(Reconciler.class);
6262
final var configuration = mock(ControllerConfiguration.class);
6363
when(configuration.getResourceClass()).thenReturn(TestCustomResource.class);

0 commit comments

Comments
 (0)