Merge pull request #1164 from weaveworks/1162_detect_host_netns_in_container
fix detection of host netns when weave script runs inside container
This commit is contained in:
commit
77bc56751b
1 file changed
+1
-1
@@ -359,7 +359,7 @@ netnsenter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect_container_to_bridge() {
|
connect_container_to_bridge() {
|
||||||
if [ -h "$PROCFS/$CONTAINER_PID/ns/net" -a -h "$PROCFS/$$/ns/net" -a "$(readlink $PROCFS/$CONTAINER_PID/ns/net)" = "$(readlink $PROCFS/$$/ns/net)" ] ; then
|
if [ -h "$PROCFS/$CONTAINER_PID/ns/net" -a -h "/proc/$$/ns/net" -a "$(readlink $PROCFS/$CONTAINER_PID/ns/net)" = "$(readlink /proc/$$/ns/net)" ] ; then
|
||||||
echo "Container is running in the host network namespace, and therefore cannot be" >&2
|
echo "Container is running in the host network namespace, and therefore cannot be" >&2
|
||||||
echo "connected to weave. Perhaps the container was started with --net=host." >&2
|
echo "connected to weave. Perhaps the container was started with --net=host." >&2
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in new issue
Block a user