Merge pull request #1477 from yummypeng/save-own-ns-path
Always save own namespace paths
This commit is contained in:
commit
b313a75364
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue