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

Fix getting hostname for HOST networking #25

Merged
merged 4 commits into from
Jun 12, 2016
Merged

Conversation

alenkacz
Copy link
Contributor

For host networked container it uses localhost as a default

fixes #24

@@ -111,7 +111,9 @@ class ComposeUp extends DefaultTask {
String gateway
Map<String, Object> networkSettings = inspection.NetworkSettings
Map<String, Object> networks = networkSettings.Networks
if (networks) {
if (networks && networks.every { it.key.toLowerCase().equals("host") }) {
gateway = 'localhost'
Copy link
Member

Choose a reason for hiding this comment

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

Please add logger.debug() here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

if (networks) {
if (networks && networks.every { it.key.toLowerCase().equals("host") }) {
gateway = 'localhost'
logger.debug("Will use $gateway as host of $serviceName beacuse it is using HOST network")
Copy link
Member

Choose a reason for hiding this comment

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

Typo in beacuse :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo fixed :)

@augi augi merged commit 81fe00a into avast:master Jun 12, 2016
@augi
Copy link
Member

augi commented Jun 12, 2016

Released as 0.3.4

@pzbitskiy
Copy link

This is actually breaks tests on Windows then boot2docker VM is used:

test.environment.get('WEB_HOST') == 'localhost'
|    |           |               |
|    |           172.17.1.100    false
|    |                           12 differences (0% similarity)
|    |                           (172.17.1.100)
|    |                           (localhost---)

@alenkacz
Copy link
Contributor Author

alenkacz commented Jun 13, 2016

@pzbitskiy ha! thanks, I'll fix that...

I moved this to #28

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.

Service host is not available for container with HOST networking
3 participants