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

filter mapped ports when port numbers are not specified #3948

Closed

Conversation

ghost
Copy link

@ghost ghost commented Mar 29, 2021

This fixes the issue which happens on some verisons of docker on some platforms (particulalrly, on macOS X) when port mapping comes in form of 0.0.0.0:0:80.

import static org.mockito.Mockito.when;
import static org.rnorth.visibleassertions.VisibleAssertions.*;

public class ContainerStateTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please make this test parameterized?

.map(Integer::valueOf)
.filter(port -> port.compareTo(0) > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason why port > 0 cannot be used?

@rnorth
Copy link
Member

rnorth commented Apr 11, 2021

I'd like to expedite this as it causes clear problems and breaks the Testcontainers build with the latest Docker Desktop (on Mac at least). As people upgrade it'll start to cause more issues, and we should cut a release with this fix in place.

@wrover thanks so much for the contribution - if you don't mind I might pick this PR up today and finish it off so that we can release soon. WDYT?

@rnorth
Copy link
Member

rnorth commented Apr 11, 2021

I don't have permission to push to this PR's branch, so I've created a new PR: #3979
Just finishing off applying @bsideup's suggestions.

I'll close this PR - thanks for creating it originally, @wrover.

@rnorth rnorth closed this Apr 11, 2021
rnorth added a commit that referenced this pull request Apr 11, 2021
…) (#3979)

Co-authored-by: Ilia Rodionov <ilya.rodionov@gmail.com>
@bsideup bsideup added this to the next milestone Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants