Fixed the check for network namespace path.#290
Fixed the check for network namespace path.#290dcbw merged 1 commit intocontainernetworking:masterfrom asridharan:dcos
Conversation
|
I suggest we completely remove this check. As @asridharan pointed out, namespace handles can be bind mounted. Container runtime might choose to do the bind mount to keep the namespace open. This is a very common practice. |
|
Seems OK to me... I think the main reason for the "ns" path check was to capture stuff like /proc/18768/task/18798/ns/net. |
|
Yep, no objection from me either. @steveej any thoughts? |
|
So the consensus is to remove the check completely under the |
|
LGTM, perhaps pending a change to the commit-message style so that it follows the contribution guidelines? |
|
@rosenhouse updated the commit message to follow the contribution guidelines. For the |
|
@asridharan if you change the prefix to "pkg/ns" then I'll merge it. Thanks! |
|
@asridharan I don't think there's a predefined list, but a quick "git log pkg/ns" or for whatever module will show what previous commits have used. |
The expectation on older kernels (< 3.19) was to have the network namespace always be a directory. This is not true if the network namespace is bind mounted to a file, and will make the plugin fail erroneously in such cases. The fix is to remove this assumption completely and just do a basic check on the file system types being returned. Fixes #288
|
Ah !! @dcbw thanks!! Just updated the commit message. |
|
@steveej this seems reasonable to me for now; if we want to catch random /proc paths passed in I guess we should figure out what to do there and take bind-mounted paths into account too. Merging for now... |
The expectation on older kernels (< 3.19) was to have the network
namespace always be a directory. This is not true if the network
namespace is bind mounted to a file, and will make the plugin fail
erroneously in such cases.
I have tried this with Mesos on a CentOS 7 cluster, running 3.10 kernel and it works fine. Moreover, have also tried it on Ubuntu 14.04 which has 3.13 kernel and works fine on that as well.
This should fix #288