kcrane opened a new pull request, #618:
URL: https://github.com/apache/camel-quarkus-examples/pull/618

   Three test resources hardcode their container images, so they cannot run on 
an architecture the
   image does not publish. `CustomPahoTestResource` and 
`ElasticSearchTestResource` already carry an
   architecture switch, but it only handles `ppc64le`:
   
   ```java
   String imageName = 
"quay.io/arkmq-org/activemq-artemis-broker:artemis.2.52.0";
   if ("ppc64le".equals(SystemUtils.OS_ARCH)) {
       imageName = "icr.io/ppc64le-oss/activemq-artemis-broker-ppc64le:2.0.2";
   }
   ```
   
   `SagaTestResource` hardcodes its two images outright, with no switch at all.
   
   Rather than add an `s390x` branch and then another branch for the next 
architecture, this makes the
   images configurable, following the pattern `Aws2S3TestResource` already uses:
   
   ```java
   // Aws2S3TestResource.java
   DockerImageName imageName = DockerImageName
           .parse(config.getValue("floci.container.image", String.class));
   ```
   
   New properties, all optional:
   
   | Property | Module |
   |---|---|
   | `artemis.container.image` | `artemis-elasticsearch`, `saga` |
   | `elasticsearch.container.image` | `artemis-elasticsearch` |
   | `lra-coordinator.container.image` | `saga` |
   
   Behaviour is unchanged when a property is unset — including on ppc64le, 
since the existing
   architecture switch is preserved as the default. The property simply takes 
precedence when supplied:
   
   ```java
   String imageName = ConfigProvider.getConfig()
           .getOptionalValue("artemis.container.image", String.class)
           .orElseGet(() -> "ppc64le".equals(SystemUtils.OS_ARCH) ? 
PPC64LE_IMAGE : DEFAULT_IMAGE);
   ```
   
   This lets CI on s390x — and any future architecture — supply working images 
from the Maven command
   line without further code changes.
   
   ### Testing
   
   `artemis-elasticsearch` and `saga` both `mvn clean test-compile` cleanly 
with the change applied,
   and the `formatter`, `impsort` and `license` plugins leave it untouched. 
Existing behaviour is
   unaffected when the new properties are unset.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to