8000 fix: remove extra dependencies from the operator by shawkins · Pull Request #47912 · keycloak/keycloak · GitHub
[go: up one dir, main page]

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 @@ -117,6 +117,7 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback {
public static final String OPERATOR_KUBERNETES_IP = "test.operator.kubernetes.ip";
public static final String OPERATOR_CUSTOM_IMAGE = "test.operator.custom.image";
public static final String POSTGRESQL_NAME = "postgresql-db";
public static final String KEYCLOAK_OPERATOR = "keycloak-operator";

public static final String TEST_RESULTS_DIR = "target/operator-test-results/";
public static final String POD_LOGS_DIR = TEST_RESULTS_DIR + "pod-logs/";
Expand Down Expand Up @@ -401,7 +402,7 @@ public void afterEach(QuarkusTestMethodContext context) {
logKeycloaks();
logKeycloakRealmImports();
if (operatorDeployment == OperatorDeployment.remote) {
log(k8sclient.apps().deployments().withName("keycloak-operator"), Deployment::getStatus, false);
log(k8sclient.apps().deployments().withName(KEYCLOAK_OPERATOR), Deployment::getStatus, false);
}
if (operatorDeployment != OperatorDeployment.local_apiserver) {
logFailed(k8sclient.apps().statefulSets().withName(POSTGRESQL_NAME), StatefulSet::getStatus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

@DisabledIfApiServerTest
Expand Down Expand Up @@ -114,6 +115,14 @@ public void testBasicKeycloakDeploymentAndDeletion() {
k8sclient.resource(kc).delete();
Awaitility.await()
.untilAsserted(() -> assertThat(k8sclient.apps().statefulSets().inNamespace(namespace).withName(deploymentName).get()).isNull());

// check that the operator is not attempting to use telemetry
if (operatorDeployment == OperatorDeployment.remote) {
String log = k8sclient.apps().deployments().withName(BaseOperatorTest.KEYCLOAK_OPERATOR).getLog();
if (log != null) {
assertFalse(log.contains("opentelemetry"), "Should not mention opentelemetry " + log);
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.keycloak.operator.crds.v2beta1.deployment.Keycloak;
import org.keycloak.operator.crds.v2beta1.deployment.ValueOrSecret;
import org.keycloak.utils.StringUtil;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Tag;
Expand All @@ -26,7 +25,7 @@ protected Keycloak getTestDeployment(boolean disableProbes) {

if (existingJavaOptsAppend != null) {
String existingValue = existingJavaOptsAppend.getValue();
if (StringUtil.isNotBlank(existingValue)) {
if (existingValue != null && !existingValue.isBlank()) {
existingJavaOptsAppend.setValue(existingValue + " " + newClientService 10000 Property);
} else {
existingJavaOptsAppend.setValue(newClientServiceProperty);
Expand Down
2 changes: 2 additions & 0 deletions rest/admin-v2/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi-private</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
2 changes: 2 additions & 0 deletions rest/admin-v2/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
Expand All @@ -41,6 +42,7 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<scope>provided</scope>
</dependency>
<!-- used by OAS Filter during OpenAPI spec generation -->
<dependency>
Expand Down
Loading
0