Ensures the CRDs are ready for use after installed (#22622)
also decreases the default poll interval Closes #22506
This commit is contained in:
parent
e8abe71833
commit
07a4bc4db1
1 changed files with 6 additions and 1 deletions
|
@ -51,6 +51,7 @@ import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecBuilder;
|
||||||
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecFluent.UnsupportedNested;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecFluent.UnsupportedNested;
|
||||||
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatus;
|
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatus;
|
||||||
import org.keycloak.operator.crds.v2alpha1.deployment.spec.UnsupportedSpecFluent.PodTemplateNested;
|
import org.keycloak.operator.crds.v2alpha1.deployment.spec.UnsupportedSpecFluent.PodTemplateNested;
|
||||||
|
import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport;
|
||||||
import org.keycloak.operator.testsuite.utils.K8sUtils;
|
import org.keycloak.operator.testsuite.utils.K8sUtils;
|
||||||
import org.opentest4j.TestAbortedException;
|
import org.opentest4j.TestAbortedException;
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@ import java.net.URL;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import jakarta.enterprise.inject.Instance;
|
import jakarta.enterprise.inject.Instance;
|
||||||
import jakarta.enterprise.inject.spi.CDI;
|
import jakarta.enterprise.inject.spi.CDI;
|
||||||
|
@ -156,6 +158,9 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback {
|
||||||
static void createCRDs(KubernetesClient client) throws FileNotFoundException {
|
static void createCRDs(KubernetesClient client) throws FileNotFoundException {
|
||||||
K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloaks.k8s.keycloak.org-v1.yml"));
|
K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloaks.k8s.keycloak.org-v1.yml"));
|
||||||
K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloakrealmimports.k8s.keycloak.org-v1.yml"));
|
K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloakrealmimports.k8s.keycloak.org-v1.yml"));
|
||||||
|
|
||||||
|
Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS).untilAsserted(() -> client.resources(Keycloak.class).list());
|
||||||
|
Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS).untilAsserted(() -> client.resources(KeycloakRealmImport.class).list());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerReconcilers() {
|
private static void registerReconcilers() {
|
||||||
|
@ -239,7 +244,7 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setDefaultAwaitilityTimings() {
|
private static void setDefaultAwaitilityTimings() {
|
||||||
Awaitility.setDefaultPollInterval(Duration.ofSeconds(1));
|
Awaitility.setDefaultPollInterval(Duration.ofMillis(500));
|
||||||
Awaitility.setDefaultTimeout(Duration.ofSeconds(360));
|
Awaitility.setDefaultTimeout(Duration.ofSeconds(360));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue