parent
874d2063b8
commit
b4e876364a
3 changed files with 4 additions and 8 deletions
|
@ -265,7 +265,7 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback {
|
|||
return;
|
||||
}
|
||||
try {
|
||||
if (!context.getTestStatus().isTestFailed() && !(context.getTestStatus().getTestErrorCause() instanceof TestAbortedException)) {
|
||||
if (!context.getTestStatus().isTestFailed() || context.getTestStatus().getTestErrorCause() instanceof TestAbortedException) {
|
||||
return;
|
||||
}
|
||||
Log.warnf("Test failed with %s: %s", context.getTestStatus().getTestErrorCause().getMessage(), context.getTestStatus().getTestErrorCause().getClass().getName());
|
||||
|
|
|
@ -22,6 +22,7 @@ import io.fabric8.kubernetes.api.model.SecretBuilder;
|
|||
import io.fabric8.kubernetes.api.model.apps.StatefulSet;
|
||||
import io.quarkus.logging.Log;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
|
||||
import org.awaitility.Awaitility;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -105,7 +106,7 @@ public class WatchedSecretsTest extends BaseOperatorTest {
|
|||
|
||||
@Test
|
||||
public void testSecretsCanBeUnWatched() {
|
||||
var kc = getTestKeycloakDeployment(true);
|
||||
var kc = getTestKeycloakDeployment(false);
|
||||
deployKeycloak(k8sclient, kc, true);
|
||||
|
||||
Log.info("Updating KC to not to rely on DB Secret");
|
||||
|
@ -230,7 +231,7 @@ public class WatchedSecretsTest extends BaseOperatorTest {
|
|||
kc.getSpec().getDatabaseSpec().setUsernameSecret(null);
|
||||
kc.getSpec().getDatabaseSpec().setPasswordSecret(null);
|
||||
|
||||
var username = new ValueOrSecret("db-username", "postgres");
|
||||
var username = new ValueOrSecret("db-username", "kc-user");
|
||||
var password = new ValueOrSecret("db-password", "testpassword");
|
||||
|
||||
kc.getSpec().getAdditionalOptions().remove(username);
|
||||
|
|
|
@ -30,7 +30,6 @@ import io.quarkus.logging.Log;
|
|||
|
||||
import org.awaitility.Awaitility;
|
||||
import org.keycloak.operator.crds.v2alpha1.deployment.Keycloak;
|
||||
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecBuilder;
|
||||
import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatusCondition;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -84,10 +83,6 @@ public final class K8sUtils {
|
|||
set(client, getDefaultTlsSecret());
|
||||
}
|
||||
|
||||
// speed the cleanup of pods
|
||||
kc.setSpec(new KeycloakSpecBuilder(kc.getSpec()).editOrNewUnsupported().editOrNewPodTemplate().editOrNewSpec()
|
||||
.withTerminationGracePeriodSeconds(0L).endSpec().endPodTemplate().endUnsupported().build());
|
||||
|
||||
set(client, kc);
|
||||
|
||||
if (waitUntilReady) {
|
||||
|
|
Loading…
Reference in a new issue