This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 1849a52cf8 [closes #8522] IBMMQ: Use filesystembind instead of
copytocontainer for secrets
1849a52cf8 is described below
commit 1849a52cf8b77b304fc26b3b02e5e248efbdb9ac
Author: Andrej Vaňo <[email protected]>
AuthorDate: Mon Apr 13 19:21:17 2026 +0200
[closes #8522] IBMMQ: Use filesystembind instead of copytocontainer for
secrets
---
.../component/jms/ibmmq/support/IBMMQTestResource.java | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git
a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java
b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java
index 407c9b65fb..0541a8eeb5 100644
---
a/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java
+++
b/integration-tests/jms-ibmmq-client/src/test/java/org/apache/camel/quarkus/component/jms/ibmmq/support/IBMMQTestResource.java
@@ -16,12 +16,17 @@
*/
package org.apache.camel.quarkus.component.jms.ibmmq.support;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.Map;
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
import org.eclipse.microprofile.config.ConfigProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.BindMode;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
@@ -45,14 +50,23 @@ public class IBMMQTestResource implements
QuarkusTestResourceLifecycleManager {
@Override
public Map<String, String> start() {
+ Path passwordFile = Paths.get("target").resolve("password");
+ try {
+ Files.writeString(passwordFile, PASSWORD);
+ } catch (IOException e) {
+ throw new RuntimeException("Unable to create password file", e);
+ }
+
container = new GenericContainer<>(DockerImageName.parse(IMAGE_NAME))
.withLogConsumer(new Slf4jLogConsumer(LOG))
.withExposedPorts(PORT)
.withEnv(Map.of(
"LICENSE", LICENSE_APPROVAL,
"MQ_QMGR_NAME", QUEUE_MANAGER_NAME))
- .withCopyToContainer(Transferable.of(PASSWORD),
"/run/secrets/mqAdminPassword")
- .withCopyToContainer(Transferable.of(PASSWORD),
"/run/secrets/mqAppPassword")
+ // prefer filesystembind over copytocontainer as copying to
/run/secrets does not work for rootless podman
+ .withFileSystemBind(passwordFile.toAbsolutePath().toString(),
"/run/secrets/mqAdminPassword",
+ BindMode.READ_ONLY)
+ .withFileSystemBind(passwordFile.toAbsolutePath().toString(),
"/run/secrets/mqAppPassword", BindMode.READ_ONLY)
.withCopyToContainer(Transferable.of(mqscConfig()),
MQSC_FILE_CONTAINER_PATH)
// AMQ5806I is a message code for queue manager start
.waitingFor(Wait.forLogMessage(".*AMQ5806I.*", 1));