Skip to content
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

chore: lookup exposed ports in the image from Config, not from ContainerConfig #2039

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

mdelapenya
Copy link
Member

@mdelapenya mdelapenya commented Dec 21, 2023

What does this PR do?

This PR uses the Docker type image.Config to the lookup of the exposed ports from the underlying image.

Why is it important?

If there are no exposed ports in the container request, the code previously checked the Docker type image.ContainerConfig. There are recent errors in the GH actions regarding this: exposed ports being moved from image.ContainerConfig to image.Config, because it has been deprecated and depending on how the images were built it could be the case that the ContainerConfig field comes empty (e.g. images built with buildkit).

Related issues

@mdelapenya mdelapenya requested a review from a team as a code owner December 21, 2023 10:06
@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Dec 21, 2023
@mdelapenya mdelapenya self-assigned this Dec 21, 2023
Copy link

netlify bot commented Dec 21, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit ee372b2
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6584118f1cdab400091f236e
😎 Deploy Preview https://deploy-preview-2039--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya changed the title fix: lookup exposed ports in the image config too chore: lookup exposed ports in the image config too Dec 21, 2023
@mdelapenya
Copy link
Member Author

Core tests passed, merging now to rebase existing PRs

@mdelapenya mdelapenya changed the title chore: lookup exposed ports in the image config too chore: lookup exposed ports in the image from Config, not from ContainerConfig Dec 21, 2023
@mdelapenya mdelapenya merged commit 5faf6f4 into testcontainers:main Dec 21, 2023
111 checks passed
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Dec 21, 2023
* main:
  chore: lookup exposed ports in the image from Config, not from ContainerConfig (testcontainers#2039)
@mdelapenya mdelapenya deleted the fix-host-port branch January 8, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants