Skip to content

Commit

Permalink
BACKPORT: Always save own namespace paths
Browse files Browse the repository at this point in the history
Fix https://bugzilla.redhat.com/show_bug.cgi?id=1510573
Upstream reference: opencontainers/runc#1477

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
  • Loading branch information
runcom committed Nov 12, 2017
1 parent c5d3116 commit 076620e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions libcontainer/configs/namespaces_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ type Namespace struct {
}

func (n *Namespace) GetPath(pid int) string {
if n.Path != "" {
return n.Path
}
return fmt.Sprintf("/proc/%d/ns/%s", pid, nsToFile(n.Type))
}

Expand Down
2 changes: 1 addition & 1 deletion libcontainer/container_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestGetContainerState(t *testing.T) {
var (
pid = os.Getpid()
expectedMemoryPath = "/sys/fs/cgroup/memory/myid"
expectedNetworkPath = "/networks/fd"
expectedNetworkPath = fmt.Sprintf("/proc/%d/ns/net", pid)
)
container := &linuxContainer{
id: "myid",
Expand Down

0 comments on commit 076620e

Please sign in to comment.