Skip to content

Commit

Permalink
Add cert-manager wait to start properly (#30)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys authored Aug 29, 2024
1 parent d8f440b commit f959d41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

/**
* Installer of Cert-manager using yaml manifests files
Expand All @@ -36,6 +38,8 @@ public class CertManagerManifestInstaller {
* Deployment name for Cert-manager
*/
public static final String DEPLOYMENT_NAME = "cert-manager";
public static final String WEBHOOK_DEPLOYMENT_NAME = "cert-manager-webhook";
public static final String CA_INJECTION_DEPLOYMENT_NAME = "cert-manager-cainjector";

/**
* Operator namespace
Expand Down Expand Up @@ -83,7 +87,12 @@ public static CompletableFuture<Void> install() throws IOException {

private static boolean isReady() {
if (KubeResourceManager.getKubeClient().getClient().apps()
.deployments().inNamespace(OPERATOR_NS).withName(DEPLOYMENT_NAME).isReady()) {
.deployments().inNamespace(OPERATOR_NS).withName(DEPLOYMENT_NAME).isReady() &&
KubeResourceManager.getKubeClient().getClient().apps()
.deployments().inNamespace(OPERATOR_NS).withName(WEBHOOK_DEPLOYMENT_NAME).isReady() &&
KubeResourceManager.getKubeClient().getClient().apps()
.deployments().inNamespace(OPERATOR_NS).withName(CA_INJECTION_DEPLOYMENT_NAME).isReady()) {
LockSupport.parkNanos(TimeUnit.SECONDS.toNanos(60));
LOGGER.info("Cert-manager {}/{} is ready", OPERATOR_NS, DEPLOYMENT_NAME);
return true;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/streams/e2e/flink/sql/SqlExampleST.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ void prepareOperators() throws IOException {

CompletableFuture.allOf(
StrimziManifestInstaller.install(),
FlinkManifestInstaller.install(),
ApicurioRegistryManifestInstaller.install()).join();
ApicurioRegistryManifestInstaller.install(),
FlinkManifestInstaller.install()).join();
}

@Test
Expand Down

0 comments on commit f959d41

Please sign in to comment.