Add support for --network=netns:/proc/pid/ns/net#271
Add support for --network=netns:/proc/pid/ns/net#271runcom merged 1 commit intoprojectatomic:docker-1.12.6from
Conversation
There was a problem hiding this comment.
I cannot test this patch with 1.12.6 because I'm on Fedora 26 but I ported the patch to 1.13.1 and I noticed there are other code paths in this file where you should call mode.IsNetNs() and exit before docker can continue setting up network.
|
See #272 for a review and the port to 1.13.1 as well |
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
79be63d to
ff4e3a7
Compare
|
Updated. |
|
LGTM, but there's no way I can test this out unfortunately :( |
|
I tested it on Fedora 26. |
|
@lsm5 can we build a new docker rpm with this? |
|
@mrunalp @runcom i'm preparing to consume this but i don't know how to determine my container's pid:
since my logic is running inside the pod, as far as it's concerned it's pid is "1". |
|
@bparees We need two things. 1. pid 2. path to resolv.conf |
|
@bparees See https://github.com/google/cadvisor/pull/1741/files for an example on how to talk to cri-o inspect endpoint. Also, resolv.conf path will be returned as part of annotations. |
To test this run a cri-o container and then get its pid and pass --network=netns:/proc/pid/ns/net of the cri-o container. You should then see the same
ip aoutput inside both these containers.@rhatdan @runcom
Signed-off-by: Mrunal Patel mrunalp@gmail.com
cc: @lsm5 we need a new rpm as soon as this is merged.