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

Fallback to getDefaultGateway() if "bridge" is unavailable. #2429

Merged
merged 1 commit into from Mar 25, 2020

Conversation

bsideup
Copy link
Member

@bsideup bsideup commented Mar 13, 2020

Fixes #2239

Comment on lines +221 to +223
.orElseGet(() -> {
return DockerClientConfigUtils.getDefaultGateway().orElse("localhost");
});

Choose a reason for hiding this comment

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

Suggested change
.orElseGet(() -> {
return DockerClientConfigUtils.getDefaultGateway().orElse("localhost");
});
.orElseGet(() -> DockerClientConfigUtils.getDefaultGateway().orElse("localhost"));

Copy link
Member Author

Choose a reason for hiding this comment

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

No, thank you, it is done for readability :)

Choose a reason for hiding this comment

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

ok, thought you had multiline lambda to begin with, but ended up in oneliner later on forgetting to remove the braces :)

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, no, just I don't like "long short lambdas" (lol). Thanks for suggesting anyways! 👍

Choose a reason for hiding this comment

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

long short lambdas
🤣

Copy link
Member

@kiview kiview left a comment

Choose a reason for hiding this comment

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

TBH I don't understand the root cause of @NersesAM 's problem with our code, but if this fixes it, better safe than sorry.

@bsideup bsideup merged commit d4f894f into master Mar 25, 2020
@delete-merged-branch delete-merged-branch bot deleted the fallback_to_getDefaultGateway branch March 25, 2020 10:44
@rnorth
Copy link
Member

rnorth commented Apr 13, 2020

This was released in https://github.com/testcontainers/testcontainers-java/releases/tag/1.14.0 🎉

Thanks for the contribution!

quincy pushed a commit to quincy/testcontainers-java that referenced this pull request May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong gateway is detected starting with Testcontainers 1.12.4
4 participants