atiaomar1978-hub commented on PR #25284:
URL: https://github.com/apache/camel/pull/25284#issuecomment-5155258085

   _AI-generated comment on behalf of 
[atiaomar1978-hub](https://github.com/atiaomar1978-hub)_
   
   ### Investigation
   
   CI failure in 
[CAMEL-24323](https://issues.apache.org/jira/browse/CAMEL-24323) showed 
Testcontainers failing during `CopyArchiveToContainer` with `Could not find the 
file / in container` when starting `mirror.gcr.io/mongo:7.0.31-jammy`.
   
   The TLS service introduced in CAMEL-23182 (#21951) used:
   
   ```java
   .withClasspathResourceMapping(CERT_RESOURCE_PATH, "/etc/mongodb/ssl", 
BindMode.READ_ONLY)
   ```
   
   On **Testcontainers 2.x** (Camel uses `2.0.5`), read-only classpath 
directory mappings use a copy strategy that does not reliably mount directory 
contents — individual file copy is the portable fix.
   
   ### Fix
   
   Switched to per-file copy (Kafka JAAS pattern):
   
   ```java
   
.withCopyFileToContainer(MountableFile.forClasspathResource(SERVER_CERT_RESOURCE),
 ...)
   
.withCopyFileToContainer(MountableFile.forClasspathResource(CA_CERT_RESOURCE), 
...)
   ```
   
   ### Tests (all green locally)
   
   | Suite | Tests |
   |-------|-------|
   | `MongoDBLocalContainerTLSServiceTest` | 3/3 |
   | `MongoDbSslConnectionIT` | 3/3 (Docker) |
   
   Ready for review once CI completes.


-- 
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