From 72710b7542a04b384f39dc0a29049270984d866c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 30 Mar 2017 14:04:15 -0500 Subject: [PATCH] Revert "Return empty network namespace if the infra container has exited" This reverts commit fee4c9a7d94e4a44a3b54f04f4e6e17fe2dde3f5. 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. --- pkg/kubelet/dockershim/helpers.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/kubelet/dockershim/helpers.go b/pkg/kubelet/dockershim/helpers.go index ce82629bfae..1fb5e8f0aa5 100644 --- a/pkg/kubelet/dockershim/helpers.go +++ b/pkg/kubelet/dockershim/helpers.go @@ -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) }