-
-
Notifications
You must be signed in to change notification settings - Fork 500
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
#1152 execute HostConfigModifier at last #1153
Conversation
testcontainers#1152 execute HostConfigModifier at last, or some values will be overwrite
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@xmh19936688 could you extend the existing unit tests to demonstrate the bug? 🙏 |
golangci-lint is complaining that there is a file not go-fmt'ed. Could you check it? |
Could you double check that the existing tests are passing? I see |
At line 110, it says |
I think the tests in this case are driven by the implementation/execution of
What is your idea or use case for it? I remember implementing the lifecycle code as a refactor of the at-that-time existing code, so I tried to replicate it adding unit tests for it. |
I'd like to specify a host port instead of the random one. So the prerequisite of specifing hostIP and hostPort is it has been exposed, right? |
I see your point: because the host config modifier allows to define e.g. custom PortBindings, then they are not applied because the Then I'm OK with changing the order. Do you think we can update the tests to represent the changes in the behaviours? |
Sounds good! I think we need some cases to represent how The port in |
We are only exposing those ports automatically if the container request exposes zero ports and the the container does not run in a container network: if len(exposedPorts) == 0 && !hostConfig.NetworkMode.IsContainer() { |
Apologize for not getting you. Should I do with that if len(exposedPorts) == 0 && !hostConfig.NetworkMode.IsContainer() {
hostConfig.PortBindings = exposedPortMap
} else {
hostConfig.PortBindings = mergePortBindings(hostConfig.PortBindings, exposedPortMap, req.ExposedPorts)
} |
I think that will do it: if there are no exposed ports, then keep the behavior of wdyt? |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'm waiting for the rest of the GH actions to pass to update this branch including all dependabot updates. Once finished, I'll merge this one.
Thanks for your patience!! 🙏
#1152 execute HostConfigModifier at last, or some values will be overwrited
What does this PR do?
execute HostConfigModifier at last
Why is it important?
Currently some values such as PortBindings will be overwrited.
Related issues