-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Conversation
Signed-off-by: Emile Vauge <emile@vauge.com>
Signed-off-by: Emile Vauge <emile@vauge.com>
991a666
to
6fd8979
Compare
@@ -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 { |
There was a problem hiding this comment.
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 👼
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 👼
LGTM 🐹 |
Signed-off-by: Emile Vauge <emile@vauge.com>
e924261
to
b1ecb1f
Compare
Fixes #487
Fixes #447
Signed-off-by: Emile Vauge emile@vauge.com