This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new f374f518bbe1 CAMEL-21577: Fix test-infra modules not using
container.properties for Dockerfile base images
f374f518bbe1 is described below
commit f374f518bbe1d45e3190c218f7bf4352851ddb38
Author: Torsten Mielke <[email protected]>
AuthorDate: Mon Aug 10 07:52:12 2026 +0200
CAMEL-21577: Fix test-infra modules not using container.properties for
Dockerfile base images
Externalize hardcoded base image references in camel-test-infra-smb,
camel-test-infra-cli, and camel-test-infra-hivemq (Sparkplug TCK) into
container.properties. Each module now resolves its Dockerfile base image
via LocalPropertyResolver with hub.image.name.prefix support, allowing
override via system properties and private registry proxies.
Closes #25405
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---
.../apache/camel/test/infra/cli/services/CliBuiltContainer.java | 6 ++----
.../org/apache/camel/test/infra/cli/services/Dockerfile | 2 +-
.../apache/camel/test/infra/cli}/services/container.properties | 7 ++++---
.../apache/camel/test/infra/hivemq/common/HiveMQProperties.java | 1 +
.../hivemq/services/LocalHiveMQSparkplugTCKInfraService.java | 9 ++++++++-
.../org/apache/camel/test/infra/hivemq/services/Dockerfile | 4 ++--
.../apache/camel/test/infra/hivemq/services/container.properties | 3 ++-
.../org/apache/camel/test/infra/smb/common/SmbProperties.java | 1 +
.../org/apache/camel/test/infra/smb/services/SmbContainer.java | 9 ++++++++-
.../org/apache/camel/test/infra/smb/services/Dockerfile | 3 ++-
.../apache/camel/test/infra/smb}/services/container.properties | 5 ++---
11 files changed, 33 insertions(+), 17 deletions(-)
diff --git
a/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java
b/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java
index 133858ed737c..2bad325bd87a 100644
---
a/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java
+++
b/test-infra/camel-test-infra-cli/src/main/java/org/apache/camel/test/infra/cli/services/CliBuiltContainer.java
@@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Objects;
import org.apache.camel.test.infra.cli.common.CliProperties;
+import org.apache.camel.test.infra.common.LocalPropertyResolver;
import org.apache.camel.test.infra.common.TestUtils;
import org.junit.platform.commons.util.StringUtils;
import org.slf4j.Logger;
@@ -48,9 +49,6 @@ public class CliBuiltContainer extends
GenericContainer<CliBuiltContainer> {
private static final String KEEP_RUNNING_ARG = "KEEP_RUNNING";
private static final String MOUNT_POINT = "/deployments/data";
private static final String SSH_PASSWORD_ARG = "SSH_PASSWORD_ARG";
- // NOTE: make sure to run integration tests locally when changing in order
to
- // validate potential breaking changes compatibility when building the
container
- private static final String FROM_IMAGE_NAME = "mirror.gcr.io/fedora:43";
private static final String FROM_IMAGE_ARG = "FROMIMAGE";
protected static final int DEV_CONSOLE_PORT = 8080;
protected static final int SSH_PORT = 22;
@@ -87,7 +85,7 @@ public class CliBuiltContainer extends
GenericContainer<CliBuiltContainer> {
.withFileFromClasspath("99-ssh-jbang.conf",
"org/apache/camel/test/infra/cli/services/99-ssh-jbang.conf")
.withBuildArg(FROM_IMAGE_ARG,
TestUtils.prependHubImageNamePrefixIfNeeded(
- System.getProperty(CliProperties.FROM_IMAGE,
FROM_IMAGE_NAME)))
+
LocalPropertyResolver.getProperty(CliBuiltContainer.class,
CliProperties.FROM_IMAGE)))
.withBuildArg(CAMEL_REF_ARG, params.getCamelRef())
.withBuildArg(KEEP_RUNNING_ARG,
String.valueOf(params.getKeepContainerRunning()))
.withBuildArg(SSH_PASSWORD_ARG, params.getSshPassword())
diff --git
a/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile
b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile
index 8d81b4faf7ab..e61e0c4e6a48 100644
---
a/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile
+++
b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/Dockerfile
@@ -15,7 +15,7 @@
# limitations under the License.
#
-ARG FROMIMAGE
+ARG FROMIMAGE=mirror.gcr.io/fedora:43
FROM $FROMIMAGE
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties
similarity index 82%
copy from
test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
copy to
test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties
index fd813b675eaf..b51af179ae85 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
+++
b/test-infra/camel-test-infra-cli/src/main/resources/org/apache/camel/test/infra/cli/services/container.properties
@@ -14,6 +14,7 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-hivemq.container=mirror.gcr.io/hivemq/hivemq-ce:2025.5
-hivemq.resource.path=org/apache/camel/test/infra/hivemq/services
-hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
\ No newline at end of file
+#
+# NOTE: make sure to run integration tests locally when changing in order to
+# validate potential breaking changes compatibility when building the container
+cli.service.from.image=mirror.gcr.io/fedora:43
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java
b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java
index 6393832c0bca..c7bbf7945d31 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java
+++
b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/common/HiveMQProperties.java
@@ -26,6 +26,7 @@ public final class HiveMQProperties {
public static final String HIVEMQ_CONTAINER = "hivemq.container";
public static final String HIVEMQ_RESOURCE_PATH = "hivemq.resource.path";
public static final String HIVEMQ_SPARKPLUG_CONTAINER =
"hivemq.sparkplug.container";
+ public static final String HIVEMQ_SPARKPLUG_FROM_IMAGE =
"hivemq.sparkplug.from.image";
public static final String HIVEMQ_SPARKPLUG_INSTANCE_SELECTOR =
"hivemq-sparkplug";
public static final String HIVEMQ_TEST_SERVICE_NAME = "hivemq";
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java
b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java
index ebf4fbd9ecaa..e4a4797d862d 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java
+++
b/test-infra/camel-test-infra-hivemq/src/main/java/org/apache/camel/test/infra/hivemq/services/LocalHiveMQSparkplugTCKInfraService.java
@@ -18,6 +18,7 @@ package org.apache.camel.test.infra.hivemq.services;
import org.apache.camel.spi.annotations.InfraService;
import org.apache.camel.test.infra.common.LocalPropertyResolver;
+import org.apache.camel.test.infra.common.TestUtils;
import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil;
import org.apache.camel.test.infra.hivemq.common.HiveMQProperties;
import org.testcontainers.hivemq.HiveMQContainer;
@@ -40,8 +41,14 @@ public class LocalHiveMQSparkplugTCKInfraService extends
AbstractLocalHiveMQServ
String dockerfileResourcePath =
LocalPropertyResolver.getProperty(LocalHiveMQSparkplugTCKInfraService.class,
HiveMQProperties.HIVEMQ_RESOURCE_PATH);
+ String fromImage = TestUtils.prependHubImageNamePrefixIfNeeded(
+ LocalPropertyResolver.getProperty(
+ LocalHiveMQSparkplugTCKInfraService.class,
HiveMQProperties.HIVEMQ_SPARKPLUG_FROM_IMAGE));
+
ImageFromDockerfile newImage
- = new ImageFromDockerfile(imageName,
false).withFileFromClasspath(".", dockerfileResourcePath);
+ = new ImageFromDockerfile(imageName, false)
+ .withFileFromClasspath(".", dockerfileResourcePath)
+ .withBuildArg("FROMIMAGE", fromImage);
String newImageName = newImage.get();
class TestInfraHiveMQContainer extends HiveMQContainer {
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile
b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile
index 85d62357d46a..c97438f7bb72 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile
+++
b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/Dockerfile
@@ -15,9 +15,9 @@
# limitations under the License.
#
-ARG HIVEMQ_VERSION=2024.6
+ARG FROMIMAGE=mirror.gcr.io/hivemq/hivemq-ce:2024.6
-FROM mirror.gcr.io/hivemq/hivemq-ce:$HIVEMQ_VERSION as hivemq-ce-sparkplug-tck
+FROM $FROMIMAGE as hivemq-ce-sparkplug-tck
ARG SPARKPLUG_TCK_VERSION=3.0.0
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
index fd813b675eaf..713918098f3a 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
+++
b/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
@@ -16,4 +16,5 @@
## ---------------------------------------------------------------------------
hivemq.container=mirror.gcr.io/hivemq/hivemq-ce:2025.5
hivemq.resource.path=org/apache/camel/test/infra/hivemq/services
-hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
\ No newline at end of file
+hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
+hivemq.sparkplug.from.image=mirror.gcr.io/hivemq/hivemq-ce:2024.6
diff --git
a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
index 9863a2777db2..b757e5a09e14 100644
---
a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
+++
b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
@@ -22,5 +22,6 @@ public class SmbProperties {
public static final String SHARE_NAME = "smb.service.share";
public static final String SMB_USERNAME = "smb.service.username";
public static final String SMB_PASSWORD = "smb.service.password";
+ public static final String SMB_FROM_IMAGE = "smb.service.from.image";
}
diff --git
a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
index 00337793e1d7..953a46a79d6c 100644
---
a/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
+++
b/test-infra/camel-test-infra-smb/src/main/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
@@ -19,7 +19,10 @@ package org.apache.camel.test.infra.smb.services;
import java.nio.file.Path;
+import org.apache.camel.test.infra.common.LocalPropertyResolver;
+import org.apache.camel.test.infra.common.TestUtils;
import org.apache.camel.test.infra.common.services.ContainerEnvironmentUtil;
+import org.apache.camel.test.infra.smb.common.SmbProperties;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.ImageFromDockerfile;
@@ -31,6 +34,7 @@ public class SmbContainer extends
GenericContainer<SmbContainer> {
public static final String DEFAULT_USER = "camel";
// NOTE: default value used for testing purposes only.
public static final String DEFAULT_PASSWORD = "camelTester123"; // NOSONAR
+ private static final String FROM_IMAGE_ARG = "FROMIMAGE";
public SmbContainer(boolean fixedPort) {
super(new ImageFromDockerfile("localhost/samba:camel", false)
@@ -41,7 +45,10 @@ public class SmbContainer extends
GenericContainer<SmbContainer> {
.withFileFromClasspath("smb.conf",
"org/apache/camel/test/infra/smb/services/smb.conf")
.withFileFromClasspath("start.sh",
- "org/apache/camel/test/infra/smb/services/start.sh"));
+ "org/apache/camel/test/infra/smb/services/start.sh")
+ .withBuildArg(FROM_IMAGE_ARG,
+ TestUtils.prependHubImageNamePrefixIfNeeded(
+
LocalPropertyResolver.getProperty(SmbContainer.class,
SmbProperties.SMB_FROM_IMAGE))));
ContainerEnvironmentUtil.configurePort(this, fixedPort,
SMB_PORT_DEFAULT);
diff --git
a/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile
b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile
index c272160464d4..95131e06f03c 100644
---
a/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile
+++
b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/Dockerfile
@@ -15,7 +15,8 @@
# limitations under the License.
#
-FROM mirror.gcr.io/fedora:43 as samba
+ARG FROMIMAGE=mirror.gcr.io/fedora:43
+FROM $FROMIMAGE as samba
LABEL maintainer="[email protected]"
ENV SAMBA_ROOT /opt/camel/samba
EXPOSE 139 445
diff --git
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties
similarity index 83%
copy from
test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
copy to
test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties
index fd813b675eaf..0a047dd4efcf 100644
---
a/test-infra/camel-test-infra-hivemq/src/main/resources/org/apache/camel/test/infra/hivemq/services/container.properties
+++
b/test-infra/camel-test-infra-smb/src/main/resources/org/apache/camel/test/infra/smb/services/container.properties
@@ -14,6 +14,5 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
-hivemq.container=mirror.gcr.io/hivemq/hivemq-ce:2025.5
-hivemq.resource.path=org/apache/camel/test/infra/hivemq/services
-hivemq.sparkplug.container=localhost/hivemq-ce-sparkplug-tck:camel
\ No newline at end of file
+smb.service.from.image=mirror.gcr.io/fedora:43
+