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 host Docker network #494

Merged
merged 3 commits into from
Jul 5, 2016
Merged

Fix host Docker network #494

merged 3 commits into from
Jul 5, 2016

Conversation

emilevauge
Copy link
Member

Fixes #487
Fixes #447

Signed-off-by: Emile Vauge emile@vauge.com

Signed-off-by: Emile Vauge <emile@vauge.com>
Signed-off-by: Emile Vauge <emile@vauge.com>
@@ -270,7 +270,12 @@ func (provider *Docker) getIPAddress(container dockertypes.ContainerJSON) string
}
}
}
for _, network := range container.NetworkSettings.Networks {
for networkName, network := range container.NetworkSettings.Networks {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure it's more reliable to look at container.HostConfig.NetworkMode to detect the host network mode 👼

Copy link
Member Author

Choose a reason for hiding this comment

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

OK :) How to go from pretty sure to sure? ^^
What could be unreliable using container.NetworkSettings.Networks?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, host is a reserved named for network (to map the networkMode host) but well…
The other thing is on versions, networkMode is guaranteed to be there since… well a while…, but NetworkSettings.Networks has been updated quite a while.

Anyway that's just a nit, backward compatibility should make it that it works ok like that for more than a while 👼

@vdemeester
Copy link
Contributor

LGTM 🐹

Signed-off-by: Emile Vauge <emile@vauge.com>
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.

3 participants