Skip to content
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 @@ -32,6 +32,7 @@ public abstract class AbstractOperatorExtension implements HasKubernetesClient,
AfterEachCallback {

private static final Logger LOGGER = LoggerFactory.getLogger(AbstractOperatorExtension.class);
public static final int CRD_READY_WAIT = 2000;

private final KubernetesClient kubernetesClient;
protected final ConfigurationService configurationService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ protected void before(ExtensionContext context) {
try (InputStream is = new FileInputStream(crdFile)) {
final var crd = kubernetesClient.load(is);
crd.createOrReplace();
crd.waitUntilReady(2, TimeUnit.SECONDS);
Thread.sleep(CRD_READY_WAIT); // readiness is not applicable for CRD, just wait a little
LOGGER.debug("Applied CRD with name: {}", crd.get().get(0).getMetadata().getName());
} catch (InterruptedException ex) {
LOGGER.error("Interrupted.", ex);
Thread.currentThread().interrupt();
} catch (Exception ex) {
throw new IllegalStateException("Cannot apply CRD yaml: " + crdFile.getAbsolutePath(), ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected void before(ExtensionContext context) {
try (InputStream is = getClass().getResourceAsStream(path)) {
final var crd = kubernetesClient.load(is);
crd.createOrReplace();
Thread.sleep(2000); // readiness is not applicable for CRD, just wait a little
Thread.sleep(CRD_READY_WAIT); // 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);
Expand Down