Fixed the docker netns detection err on xenial (#15)

With ubuntu 16.04 and docker-engine 1.11, the docker netns detection
function failed to look for the correct location of task file. This
change fixed the issue.

Signed-off-by: Zhenfang Wei <kopkop@gmail.com>
This commit is contained in:
Zhenfang Wei 2016-04-30 07:37:00 +02:00 committed by Vish Ishaya
parent 003a74c01d
commit 11c323fbd3
1 changed files with 2 additions and 0 deletions

View File

@ -182,6 +182,8 @@ func getPidForContainer(id string) (int, error) {
filepath.Join(cgroupRoot, cgroupThis, "docker", id, "tasks"), filepath.Join(cgroupRoot, cgroupThis, "docker", id, "tasks"),
// Even more recent docker versions under systemd use docker-<id>.scope/ // Even more recent docker versions under systemd use docker-<id>.scope/
filepath.Join(cgroupRoot, "system.slice", "docker-"+id+".scope", "tasks"), filepath.Join(cgroupRoot, "system.slice", "docker-"+id+".scope", "tasks"),
// Even more recent docker versions under cgroup/systemd/docker/<id>/
filepath.Join(cgroupRoot, "..", "systemd", "docker", id, "tasks"),
} }
var filename string var filename string