Merge pull request #1477 from yummypeng/save-own-ns-path

Always save own namespace paths
This commit is contained in:
Daniel, Dao Quang Minh
2017-08-02 11:24:30 +01:00
committed by GitHub
2 changed files with 1 additions and 4 deletions
-3
View File
@@ -79,9 +79,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, NsName(n.Type))
}
+1 -1
View File
@@ -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",