-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
fix: incorrect parsing of exposedPorts in readiness check #2658
fix: incorrect parsing of exposedPorts in readiness check #2658
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
you could extract the logic to a function and unit test it creating different port instances, covering all possible cases 🤔 |
Hi @mdelapenya , I've added some tests. Any more work that needs to be done for this PR? |
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.
Thanks for applying the previous suggestions, few more came out of that, if you would be so kind :)
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.
Looks good to me.
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, thanks!
Thanks @stevenh for driving the review, much appreciated! |
* main: chore: print Docker Info labels in banner (testcontainers#2681) fix: incorrect parsing of exposedPorts in readiness check (testcontainers#2658) feat: add grafana-lgtm module (testcontainers#2660) Added valkey module (testcontainers#2639) fix: container.Endpoint and wait.FortHTTP to use lowest internal port (testcontainers#2641)
What does this PR do?
If an explicit port mapping is given in the definition of a container (through
exposedPorts
), the default readiness check fails. See the related issue below for an example. This PR fixes the issue by using thenat.ParsePortSpecs
function instead of thenat.Port
function when parsing theexposedPorts
.Why is it important?
Anyone who upgrades to v0.32.0 and has a port defined as for example
4443:4443/tcp
will run into the below issue.Related issues
How to test this PR
I still need to add a unit test for this, any advice on how to approach this?