Skip to content

fix: Issue for "Operator Couldn't start source ..." #1070

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 3 commits into from
Mar 23, 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 @@ -4,7 +4,6 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -100,8 +99,11 @@ protected void before(ExtensionContext context) {
try (InputStream is = getClass().getResourceAsStream(path)) {
final var crd = kubernetesClient.load(is);
crd.createOrReplace();
crd.waitUntilReady(2, TimeUnit.SECONDS);
Thread.sleep(2000); // readiness is not applicable for CRD, just wait a little
LOGGER.debug("Applied CRD with name: {}", config.getResourceTypeName());
} catch (InterruptedException ex) {
LOGGER.error("Interrupted.", ex);
Thread.currentThread().interrupt();
} catch (Exception ex) {
throw new IllegalStateException("Cannot apply CRD yaml: " + path, ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.concurrent.atomic.AtomicInteger;

import io.javaoperatorsdk.operator.ReconcilerUtils;
import io.javaoperatorsdk.operator.api.reconciler.*;
import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration;
import io.javaoperatorsdk.operator.support.TestExecutionInfoProvider;
Expand All @@ -12,8 +11,6 @@ public class EventSourceTestCustomReconciler
implements Reconciler<EventSourceTestCustomResource>,
TestExecutionInfoProvider {

public static final String FINALIZER_NAME =
ReconcilerUtils.getDefaultFinalizerName(EventSourceTestCustomResource.class);
public static final int TIMER_PERIOD = 500;
private final AtomicInteger numberOfExecutions = new AtomicInteger(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class TestUtils {

public static final String TEST_CUSTOM_RESOURCE_PREFIX = "test-custom-resource-";
public static final String TEST_CUSTOM_RESOURCE_NAME = "test-custom-resource";
public static final String TEST_NAMESPACE = "java-operator-sdk-int-test";

public static TestCustomResource testCustomResource() {
return testCustomResource(UUID.randomUUID().toString());
Expand Down