Skip to content

Commit

Permalink
[issue 144] - Support Red Hat Build of Keycloak (new productised vers…
Browse files Browse the repository at this point in the history
…ion of Keycloak)
  • Loading branch information
fabiobrz committed Mar 4, 2024
1 parent 1ca7d84 commit dd2794a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .ci/openshift-ci/build-root/e2e-test-periodic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -P
-Dintersmash.activemq.operators.package_manifest=amq-broker-rhel8 \
-Dintersmash.activemq.operators.channel=7.11.x \
-Dintersmash.activemq.operators.index_image='' \
-Dintersmash.keycloak.image=registry.redhat.io/rhbk/keycloak-rhel9:latest \
-Dintersmash.keycloak.operators.catalog_source=redhat-operators \
-Dintersmash.keycloak.operators.channel=stable-v22 \
-Dintersmash.keycloak.operators.package_manifest=rhbk-operator \
-Dintersmash.keycloak.operators.index_image='' \
-Dintersmash.rhsso.image=registry.redhat.io/rh-sso-7/sso76-openshift-rhel8:latest \
-Dintersmash.rhsso.operators.catalog_source=redhat-operators \
-Dintersmash.rhsso.operators.package_manifest=rhsso-operator \
Expand Down
5 changes: 5 additions & 0 deletions .ci/openshift-ci/build-root/e2e-test-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -P
-Dintersmash.activemq.operators.package_manifest=amq-broker-rhel8 \
-Dintersmash.activemq.operators.channel=7.11.x \
-Dintersmash.activemq.operators.index_image='' \
-Dintersmash.keycloak.image=registry.redhat.io/rhbk/keycloak-rhel9:latest \
-Dintersmash.keycloak.operators.catalog_source=redhat-operators \
-Dintersmash.keycloak.operators.channel=stable-v22 \
-Dintersmash.keycloak.operators.package_manifest=rhbk-operator \
-Dintersmash.keycloak.operators.index_image='' \
-Dintersmash.rhsso.image=registry.redhat.io/rh-sso-7/sso76-openshift-rhel8:latest \
-Dintersmash.rhsso.operators.catalog_source=redhat-operators \
-Dintersmash.rhsso.operators.package_manifest=rhsso-operator \
Expand Down
2 changes: 1 addition & 1 deletion provisioners/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class PostgresqlProvisionTest {
| HyperFoil | :heavy_check_mark: | :x: | HyperfoilOperatorApplication | HyperfoilOperatorProvisioner | Operator based provisioner, see details [below](#operator-based-provisioning) |
| Infinispan & Red Hat DataGrid | :heavy_check_mark: | :heavy_check_mark: | InfinispanOperatorApplication | InfinispanOperatorProvisioner | Operator based provisioner, see details [below](#operator-based-provisioning) |
| Kafka & Red Hat AMQ Streams | :heavy_check_mark: | :heavy_check_mark: | KafkaOperatorApplication | KafkaOperatorProvisioner | Operator based provisioner, see details [below](#operator-based-provisioning) |
| Keycloak | :heavy_check_mark: | :x: | KeycloakOperatorApplication | KeycloakOperatorProvisioner | Based on the latest Quarkus based Keycloak Operator, doesn't provide stable CRDs yet (see https://www.keycloak.org/2022/09/operator-crs); this operator offers a solution which supports the `Keycloak` and `KeycloakRealmImport` Custom Resources: these are the only supported CRs at the time of writing. See details [below](#operator-based-provisioning) |
| Keycloak | :heavy_check_mark: | :heavy_check_mark: | KeycloakOperatorApplication | KeycloakOperatorProvisioner | Based on the latest Quarkus based Keycloak Operator, doesn't provide stable CRDs yet (see https://www.keycloak.org/2022/09/operator-crs); this operator offers a solution which supports the `Keycloak` and `KeycloakRealmImport` Custom Resources: these are the only supported CRs at the time of writing. See details [below](#operator-based-provisioning) |
| MySQL | :heavy_check_mark: | :x: | MysqlImageOpenShiftApplication | MysqlImageOpenShiftProvisioner | Deploys a MySQL image and sets environment variables to configure the service (ports, credentials etc.) |
| PostgreSQL | :heavy_check_mark: | :x: | PostgreSQLImageOpenShiftApplication | PostgreSQLImageOpenShiftProvisioner | Deploys a PostgreSQL image and sets environment variables to configure the service (ports, credentials etc.) |
| Wildfly & Red Hat JBoss EAP XP | :heavy_check_mark: | :heavy_check_mark: | BootableJarOpenShiftApplication | WildflyBootableJarImageOpenShiftProvisioner | Deploys a WildFly Bootable JAR, i.e. a runnable WildFly application |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
*/
@Slf4j
@CleanBeforeAll
@NotForProductizedExecutionProfile
public class KeycloakOperatorProvisionerTest {
private static KeycloakOperatorProvisioner KEYCLOAK_OPERATOR_PROVISIONER;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.jboss.intersmash.application.openshift.Eap7LegacyS2iBuildTemplateApplication;
import org.jboss.intersmash.application.openshift.Eap7TemplateOpenShiftApplication;
import org.jboss.intersmash.application.openshift.KafkaOperatorApplication;
import org.jboss.intersmash.application.openshift.KeycloakOperatorApplication;
import org.jboss.intersmash.application.openshift.MysqlImageOpenShiftApplication;
import org.jboss.intersmash.application.openshift.PostgreSQLImageOpenShiftApplication;
import org.jboss.intersmash.application.openshift.PostgreSQLTemplateOpenShiftApplication;
Expand Down Expand Up @@ -709,4 +710,28 @@ public String getPingServiceName() {
}
};
}

static KeycloakOperatorApplication getKeycloakOperatorApplication() {

final String DEFAULT_KEYCLOAK_APP_NAME = "example-sso";
return new KeycloakOperatorApplication() {
@Override
public org.keycloak.k8s.v2alpha1.Keycloak getKeycloak() {
return new org.keycloak.k8s.v2alpha1.KeycloakBuilder()
.withNewMetadata()
.withName(DEFAULT_KEYCLOAK_APP_NAME)
.withLabels(Map.of("app", getName()))
.endMetadata()
.withNewSpec()
.withInstances(1L)
.endSpec()
.build();
}

@Override
public String getName() {
return DEFAULT_KEYCLOAK_APP_NAME;
}
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.jboss.intersmash.provision.openshift.Eap7ImageOpenShiftProvisioner;
import org.jboss.intersmash.provision.openshift.Eap7LegacyS2iBuildTemplateProvisioner;
import org.jboss.intersmash.provision.openshift.KeycloakOperatorProvisioner;
import org.jboss.intersmash.provision.openshift.MysqlImageOpenShiftProvisioner;
import org.jboss.intersmash.provision.openshift.OpenShiftProvisioner;
import org.jboss.intersmash.provision.openshift.PostgreSQLImageOpenShiftProvisioner;
Expand Down Expand Up @@ -53,16 +54,23 @@ private static Stream<OpenShiftProvisioner> provisionerProvider() {
new PostgreSQLImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getPostgreSQLImageOpenShiftApplication()),
new PostgreSQLTemplateOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getPostgreSQLTemplateOpenShiftApplication()));
OpenShiftProvisionerTestBase.getPostgreSQLTemplateOpenShiftApplication()),
new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication()
));
} else if (IntersmashTestsuiteProperties.isProductizedTestExecutionProfileEnabled()) {
return Stream.of(
// EAP latest GA
new WildflyImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getWildflyOpenShiftLocalBinaryTargetServerApplication()),
// EAP 7
new Eap7ImageOpenShiftProvisioner(OpenShiftProvisionerTestBase.getEap7OpenShiftImageApplication()),
// RHSSO
new RhSsoTemplateOpenShiftProvisioner(OpenShiftProvisionerTestBase.getHttpsRhSso()));
// RHSSO 7.6.x
new RhSsoTemplateOpenShiftProvisioner(OpenShiftProvisionerTestBase.getHttpsRhSso()),
// RHBK
new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication()
));
} else {
throw new IllegalStateException(
String.format("Unknown Intersmash test suite execution profile: %s",
Expand Down

0 comments on commit dd2794a

Please sign in to comment.