Skip to content

fix: set default CRD check to false #1057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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