Revert "Return empty network namespace if the infra container has exited"

This reverts commit fee4c9a7d9.

This is not the correct fix for the problem; and it causes other problems
like continuous:

docker_sandbox.go:234] NetworkPlugin cni failed on the status hook for pod
"someotherdc-1-deploy_default": Unexpected command output nsenter: cannot
open : No such file or directory with error: exit status 1

Because GetNetNS() is returning an empty network namespace.  That is
not helpful nor should really be allowed; that's what the error return
from GetNetNS() is for.
This commit is contained in:
Dan Williams 2017-03-30 14:04:15 -05:00
parent 695d438508
commit 72710b7542

View File

@ -267,12 +267,6 @@ func getApparmorSecurityOpts(sc *runtimeapi.LinuxContainerSecurityContext, separ
}
func getNetworkNamespace(c *dockertypes.ContainerJSON) string {
if c.State.Pid == 0 {
// Docker reports pid 0 for an exited container. We can't use it to
// check the network namespace, so return an empty string instead.
glog.V(4).Infof("Cannot find network namespace for the terminated container %q", c.ID)
return ""
}
return fmt.Sprintf(dockerNetNSFmt, c.State.Pid)
}