You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2026/04/30 10:34:13 UTC

(camel-quarkus-examples) branch main updated: IBMMQ: Use filesystembind instead of copytocontainer for secrets

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-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new f505077f IBMMQ: Use filesystembind instead of copytocontainer for secrets
f505077f is described below

commit f505077ff72426de5daf6844276a9939db124916
Author: Tomas Veskrna <ve...@gmail.com>
AuthorDate: Thu Apr 30 12:34:08 2026 +0200

    IBMMQ: Use filesystembind instead of copytocontainer for secrets
---
 .../message/bridge/resource/IBMMQTestResource.java    | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/message-bridge/src/test/java/org/acme/message/bridge/resource/IBMMQTestResource.java b/message-bridge/src/test/java/org/acme/message/bridge/resource/IBMMQTestResource.java
index c86adaa6..c3c0e5c6 100644
--- a/message-bridge/src/test/java/org/acme/message/bridge/resource/IBMMQTestResource.java
+++ b/message-bridge/src/test/java/org/acme/message/bridge/resource/IBMMQTestResource.java
@@ -16,13 +16,17 @@
  */
 package org.acme.message.bridge.resource;
 
+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.testcontainers.containers.BindMode;
 import org.testcontainers.containers.GenericContainer;
 import org.testcontainers.containers.wait.strategy.Wait;
-import org.testcontainers.images.builder.Transferable;
 import org.testcontainers.utility.DockerImageName;
 
 public class IBMMQTestResource implements QuarkusTestResourceLifecycleManager {
@@ -36,13 +40,22 @@ 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))
                 .withExposedPorts(PORT)
                 .withEnv(Map.of(
                         "LICENSE", ConfigProvider.getConfig().getValue("ibm.mq.container.license", String.class),
                         "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)
                 // AMQ5806I is a message code for queue manager start
                 .waitingFor(Wait.forLogMessage(".*AMQ5806I.*", 1));
         container.start();