Skip to content

Commit

Permalink
Merge pull request #175 from fabiobrz/fix.infinispan-op-prov.scale
Browse files Browse the repository at this point in the history
[issue 176] - FIxing the InfinispanOperatorProvisioner::scale() method
  • Loading branch information
marekkopecky authored May 21, 2024
2 parents 688d520 + a5d1214 commit 8251708
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ci/openshift-ci/build-root/e2e-test-periodic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -P
-Dintersmash.rhsso.operators.catalog_source=redhat-operators \
-Dintersmash.rhsso.operators.package_manifest=rhsso-operator \
-Dintersmash.rhsso.templates=https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso76-dev/templates/ \
-Dintersmash.infinispan.image=registry.redhat.io/jboss-datagrid-7/datagrid73-openshift:latest \
-Dintersmash.infinispan.image=registry.redhat.io/datagrid/datagrid-8-rhel8:latest \
-Dintersmash.infinispan.operators.catalog_source=redhat-operators \
-Dintersmash.infinispan.operators.package_manifest=datagrid \
-Dintersmash.infinispan.operators.channel=8.4.x \
Expand Down
2 changes: 1 addition & 1 deletion .ci/openshift-ci/build-root/e2e-test-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ mvn test -Dmaven.repo.local=./local-repo-prod -pl testsuite/integration-tests -P
-Dintersmash.rhsso.operators.catalog_source=redhat-operators \
-Dintersmash.rhsso.operators.package_manifest=rhsso-operator \
-Dintersmash.rhsso.templates=https://raw.githubusercontent.com/jboss-container-images/redhat-sso-7-openshift-image/sso76-dev/templates/ \
-Dintersmash.infinispan.image=registry.redhat.io/jboss-datagrid-7/datagrid73-openshift:latest \
-Dintersmash.infinispan.image=registry.redhat.io/datagrid/datagrid-8-rhel8:latest \
-Dintersmash.infinispan.operators.catalog_source=redhat-operators \
-Dintersmash.infinispan.operators.package_manifest=datagrid \
-Dintersmash.infinispan.operators.channel=8.4.x \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Feel free to submit an issue in such a case, Intersmash welcomes community contr
| ActiveMQ Artemis | 1.0.15 | The one provided by the custom index image, i.e. quay.io/jbossqe-eap/intersmash-activemq-operator-catalog:v1.0.11 |
| Red Hat AMQ Broker | 7.11.z | Or _latest_ in the `:7.11` tag image stream, see registry.redhat.io/amq7/amq-broker-init-rhel8 |
||||
| Infinispan | 14.0.27.Final | Or _default_ provided by the default Infinispan Operator `2.4.x` channel |
| Infinispan | 15.0.3.Final | Or _default_ provided by the default Infinispan Operator `stable` channel |
| Red Hat DataGrid | 8.4.8.GA | Or _default_ provided by the Red Hat DataGrid Operator `8.4.x` channel | |
||||
| Kafka provided by Strimzi | 3.6.0 | Provided by the Strimzi Operator `stable` channel |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ public void scale(int replicas, boolean wait) {
if (wait) {
// waits for the correct number of Pods representing the Infinispan CR replicas to be ready
new SimpleWaiter(() -> getInfinispanPods().size() == replicas).level(Level.DEBUG).waitFor();
if (replicas > 0) {
waitForResourceReadiness();
}
}
// wait for all resources to be ready
waitForResourceReadiness();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@
import java.util.Map;

import org.assertj.core.util.Strings;
import org.infinispan.v1.Infinispan;
import org.infinispan.v2alpha1.Cache;
import org.jboss.intersmash.IntersmashConfig;
import org.jboss.intersmash.application.openshift.BootableJarOpenShiftApplication;
import org.jboss.intersmash.application.openshift.Eap7ImageOpenShiftApplication;
import org.jboss.intersmash.application.openshift.Eap7LegacyS2iBuildTemplateApplication;
import org.jboss.intersmash.application.openshift.Eap7TemplateOpenShiftApplication;
import org.jboss.intersmash.application.openshift.InfinispanOperatorApplication;
import org.jboss.intersmash.application.openshift.KafkaOperatorApplication;
import org.jboss.intersmash.application.openshift.KeycloakOperatorApplication;
import org.jboss.intersmash.application.openshift.MysqlImageOpenShiftApplication;
Expand All @@ -46,6 +49,7 @@
import org.jboss.intersmash.application.openshift.template.Eap7Template;
import org.jboss.intersmash.application.openshift.template.PostgreSQLTemplate;
import org.jboss.intersmash.application.openshift.template.RhSsoTemplate;
import org.jboss.intersmash.provision.openshift.operator.infinispan.infinispan.InfinispanBuilder;
import org.jboss.intersmash.test.deployments.DeploymentsProvider;
import org.jboss.intersmash.test.deployments.TestDeploymentProperties;
import org.jboss.intersmash.test.deployments.WildflyDeploymentApplicationConfiguration;
Expand Down Expand Up @@ -759,4 +763,27 @@ public String getName() {
}
};
}

static InfinispanOperatorApplication getInfinispanOperatorApplication() {
return new InfinispanOperatorApplication() {
private static final String DEFAULT_INFINISPAN_APP_NAME = "example-infinispan";

@Override
public Infinispan getInfinispan() {
return new InfinispanBuilder(DEFAULT_INFINISPAN_APP_NAME, Map.of("app", DEFAULT_INFINISPAN_APP_NAME))
.replicas(1)
.build();
}

@Override
public List<Cache> getCaches() {
return Collections.emptyList();
}

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

import org.jboss.intersmash.provision.openshift.Eap7ImageOpenShiftProvisioner;
import org.jboss.intersmash.provision.openshift.Eap7LegacyS2iBuildTemplateProvisioner;
import org.jboss.intersmash.provision.openshift.InfinispanOperatorProvisioner;
import org.jboss.intersmash.provision.openshift.KeycloakOperatorProvisioner;
import org.jboss.intersmash.provision.openshift.MysqlImageOpenShiftProvisioner;
import org.jboss.intersmash.provision.openshift.OpenShiftProvisioner;
Expand Down Expand Up @@ -51,29 +52,37 @@ public class ProvisionerCleanupTestCase {
private static Stream<OpenShiftProvisioner> provisionerProvider() {
if (IntersmashTestsuiteProperties.isCommunityTestExecutionProfileEnabled()) {
return Stream.of(
// WildFly
new WildflyBootableJarImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getWildflyBootableJarOpenShiftApplication()),
new WildflyBootableJarImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getEap7BootableJarOpenShiftApplication()),
new MysqlImageOpenShiftProvisioner(OpenShiftProvisionerTestBase.getMysqlOpenShiftApplication()),
new PostgreSQLImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getEap7BootableJarOpenShiftApplication())
// Keycloak
, new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication())
// Infinispan
, new InfinispanOperatorProvisioner(OpenShiftProvisionerTestBase.getInfinispanOperatorApplication())
// MySQL
, new MysqlImageOpenShiftProvisioner(OpenShiftProvisionerTestBase.getMysqlOpenShiftApplication())
// PostgreSql
, new PostgreSQLImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getPostgreSQLImageOpenShiftApplication()),
new PostgreSQLTemplateOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getPostgreSQLTemplateOpenShiftApplication()),
new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication()));
OpenShiftProvisionerTestBase.getPostgreSQLTemplateOpenShiftApplication()));
} else if (IntersmashTestsuiteProperties.isProductizedTestExecutionProfileEnabled()) {
return Stream.of(
// EAP latest GA
new WildflyImageOpenShiftProvisioner(
OpenShiftProvisionerTestBase.getWildflyOpenShiftLocalBinaryTargetServerApplication()),
OpenShiftProvisionerTestBase.getWildflyOpenShiftLocalBinaryTargetServerApplication())
// EAP 7
new Eap7ImageOpenShiftProvisioner(OpenShiftProvisionerTestBase.getEap7OpenShiftImageApplication()),
, new Eap7ImageOpenShiftProvisioner(OpenShiftProvisionerTestBase.getEap7OpenShiftImageApplication())
// RHSSO 7.6.x
new RhSsoTemplateOpenShiftProvisioner(OpenShiftProvisionerTestBase.getHttpsRhSso()),
, new RhSsoTemplateOpenShiftProvisioner(OpenShiftProvisionerTestBase.getHttpsRhSso())
// RHBK
new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication()));
, new KeycloakOperatorProvisioner(
OpenShiftProvisionerTestBase.getKeycloakOperatorApplication())
// RHDG
, new InfinispanOperatorProvisioner(OpenShiftProvisionerTestBase.getInfinispanOperatorApplication()));
} else {
throw new IllegalStateException(
String.format("Unknown Intersmash test suite execution profile: %s",
Expand Down

0 comments on commit 8251708

Please sign in to comment.