From ef6f981729d0289fb1807af9cda61577bdff8724 Mon Sep 17 00:00:00 2001 From: Serguei Bezverkhi Date: Wed, 18 Jul 2018 13:59:28 -0400 Subject: [PATCH] Adding new location for containers in recent k8s 1.11+ Signed-off-by: Serguei Bezverkhi --- netns_linux.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netns_linux.go b/netns_linux.go index 34af6e2..9959a9d 100644 --- a/netns_linux.go +++ b/netns_linux.go @@ -190,6 +190,8 @@ func getPidForContainer(id string) (int, error) { filepath.Join(cgroupRoot, "..", "systemd", "docker", id, "tasks"), // Kubernetes with docker and CNI is even more different filepath.Join(cgroupRoot, "..", "systemd", "kubepods", "*", "pod*", id, "tasks"), + // Another flavor of containers location in recent kubernetes 1.11+ + filepath.Join(cgroupRoot, cgroupThis, "kubepods.slice", "kubepods-besteffort.slice", "*", "docker-"+id+".scope", "tasks"), } var filename string