mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-03 23:40:03 +00:00 
			
		
		
		
	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:
		@@ -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)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user