-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
feat: Auto detect the use of Podman from DOCKER_HOST #982
feat: Auto detect the use of Podman from DOCKER_HOST #982
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@jtwatson at first sight, LGTM! Thanks for adding this automatic detection. Could you update the docs for Podman describing what this PR does in a high level language? 🙏 |
@mdelapenya I question if the docs are accurate around when it is required to manually specify the It is probably good to leave it in so the usage is documented, but I wonder if the advice around when to use it should be corrected or not. |
I'm planning to move the logic of the provider, and many other things, to the testcontainer.properties, so it's defined when bootstrapping the library, not leaving the decision to manually add it to each container request. |
If you would like I can add a test to validate the auto-detection based on the |
…HOST contains podman.sock Updated documentation Unit tests for auto-detection of ProviderPodman Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com>
7583569
to
9e616a2
Compare
@mdelapenya I added unit tests, squashed my PR, and updated the title as a feature. Should be ready to go. |
c68a105
to
a42a35d
Compare
It's extremely weird that the neo4j module fails in a consistent manner on CI. I've fetched this branch locally, run the tests, and they pass 🤔 |
For some reason that inconsistency is no longer present 🤷 |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
* main: feat: Auto detect the use of Podman from DOCKER_HOST (testcontainers#982) chore(deps): bump github.com/opencontainers/runc from 1.1.3 to 1.1.5 (testcontainers#1017) Revert "chore: render logos from the base location (testcontainers#995)" (testcontainers#998)
) * feat: Autodetect the use of Podman if no provider is set, and DOCKER_HOST contains podman.sock Updated documentation Unit tests for auto-detection of ProviderPodman Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com> * Cleanup linter issues * Use `t.Setenv()` in tests * Fix the spelling of reap --------- Co-authored-by: Manuel de la Peña <social.mdelapenya@gmail.com> Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
What does this PR do?
When running
testcontainers-go
with Podman, it seems thatProviderType: ProviderPodman,
must always be specified.The documentation here seems to contradict my experience.
Since Podman 4 was released with a new network stack, it appears that the
default
network for Podman uses thebridge
driver and is namedpodman
. As such, the library must be configured diffrently when using Podman.This PR attempts to auto-detect when
ProviderType
has not been explicitly set and Podman is in use, using the following logic:If
ProviderType
has not been set, andDOCKER_HOST
containspodman.sock
, then useProviderPodman
Why is it important?
When attempting to use
testcontainers-go
with Podman, it appears that it is always the case thatmust be set. When it is not set, the resulting error is quite difficult to troubleshoot.
If the library can reliably detect when Podman is in use, the developer experience would be much better.
Related issues