Allow chained network namespace containers

The code currently assumes that the container we delegate network
namespace to will never further delegate to another container, so
when looking up things like /etc/hosts and /etc/resolv.conf we
won't pull the correct files from the chained dependency. The
changes to resolve this are relatively simple - just need to keep
looking until we find a container without NetNsCtr set.

Fixes #4626

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2019-12-03 10:27:15 -05:00
parent c9696c451d
commit b0b9103cca
2 changed files with 19 additions and 4 deletions

View File

@ -1146,7 +1146,7 @@ func (c *Container) NetworkDisabled() (bool, error) {
if err != nil {
return false, err
}
return networkDisabled(container)
return container.NetworkDisabled()
}
return networkDisabled(c)