fix: incorrect parsing of exposedPorts in readiness check#2658
Merged
mdelapenya merged 5 commits intotestcontainers:mainfrom Aug 5, 2024
Merged
fix: incorrect parsing of exposedPorts in readiness check#2658mdelapenya merged 5 commits intotestcontainers:mainfrom
mdelapenya merged 5 commits intotestcontainers:mainfrom
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Member
you could extract the logic to a function and unit test it creating different port instances, covering all possible cases 🤔 |
Contributor
Author
|
Hi @mdelapenya , I've added some tests. Any more work that needs to be done for this PR? |
stevenh
requested changes
Jul 26, 2024
Contributor
Author
stevenh
requested changes
Jul 27, 2024
Contributor
Author
Member
|
Thanks @stevenh for driving the review, much appreciated! |
mdelapenya
added a commit
to mdelapenya/testcontainers-go
that referenced
this pull request
Aug 6, 2024
* 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ParsePortSpecsfunction instead of thenat.Portfunction when parsing theexposedPorts.Why is it important?
Anyone who upgrades to v0.32.0 and has a port defined as for example
4443:4443/tcpwill 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?