Skip to content

Commit

Permalink
fix: set default CRD check to false (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
csviri authored Mar 22, 2022
1 parent c9c7016 commit d4df638
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ default Config getClientConfiguration() {
* @return {@code true} if CRDs should be checked (default), {@code false} otherwise
*/
default boolean checkCRDAndValidateLocalModel() {
return true;
return false;
}

int DEFAULT_RECONCILIATION_THREADS_NUMBER = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static boolean isValidateCustomResourcesEnvVarSet() {
}

public static boolean shouldCheckCRDAndValidateLocalModel() {
return getBooleanFromSystemPropsOrDefault(CHECK_CRD_ENV_KEY, true);
return getBooleanFromSystemPropsOrDefault(CHECK_CRD_ENV_KEY, false);
}

public static boolean debugThreadPool() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class UtilsTest {

@Test
void shouldCheckCRDAndValidateLocalModelByDefault() {
assertTrue(Utils.shouldCheckCRDAndValidateLocalModel());
assertFalse(Utils.shouldCheckCRDAndValidateLocalModel());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ void crdShouldNotBeCheckedForCustomResourcesIfDisabled() {
}

@Test
void crdShouldBeCheckedForCustomResourcesByDefault() {
void crdCanBeCheckedForCustomResources() {
final var client = mock(KubernetesClient.class);
final var configurationService = mock(ConfigurationService.class);
when(configurationService.checkCRDAndValidateLocalModel()).thenCallRealMethod();
when(configurationService.checkCRDAndValidateLocalModel()).thenReturn(true);
final var reconciler = mock(Reconciler.class);
final var configuration = mock(ControllerConfiguration.class);
when(configuration.getResourceClass()).thenReturn(TestCustomResource.class);
Expand Down

0 comments on commit d4df638

Please sign in to comment.