removes the termination grace period override (#22203)

Closes #22160
This commit is contained in:
Steven Hawkins 2023-08-10 06:43:38 -04:00 committed by GitHub
parent 874d2063b8
commit b4e876364a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View file

@ -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());

View file

@ -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);

View file

@ -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) {