-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always use toAbsolutePath() for MountableFile #3514
Conversation
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
e722aa7
to
4738e07
Compare
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Hello, |
@Fufusulier well, "Testcontainers isn't our primary job" is probably the best answer to "a reason why this PR is still opened" 😅 We're on it, just it takes time to handle everything. Stay tuned 👍 |
oooh ok, I thought it was. sorry :) I'm a bit impatient because I'm stuck :p |
@Fufusulier no problem! We always take it as a compliment :) We thought that the issue is in docker-java, but apparently it wasn't, so it takes a bit longer to fix it, but at least we identified the root cause and working on it 👍 |
core/src/main/java/org/testcontainers/containers/GenericContainer.java
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run Windows 10 - Docker for Windows |
Azure Pipelines successfully started running 1 pipeline(s). |
this feels good :p |
This change sadly stopped accepting Paths from a class resource. .withCopyFileToContainer(
forHostPath(TestConstants.class.getResource("vaultTest_agent.hcl").getPath()),
"/agent.hcl") I needed to copy this method since it is marked private 😓 testcontainers-java/core/src/main/java/org/testcontainers/utility/MountableFile.java Lines 169 to 179 in 61dcd7c
|
@jetersen any reason you're not using |
As I said it using a wrong class loader.
|
@jetersen are you sure the problem is with the classloaders? You seem to be providing path |
Right, that was not obvious for the method name and javadoc that I had to provide the full resource path as the variable is named |
I agree that the naming could be improved, ut it is similar to other classpath APIs (eg Spring's ClasspathResource) - you need to provide the full path, since there is no "current directory" when it comes to classpath :) |
forHostPath
inMountableFile
will now always usetoAbsolutePath()
, instead of usingtoURI()
in certain cases.Solves an issue on Windows that was introduced with the latest Docker Desktop on Windows update.
Fixes #3493.