From 70c3fe9dcd258e33d32dd33ee2af288d761ab1ca Mon Sep 17 00:00:00 2001 From: Archana Shinde Date: Tue, 17 Apr 2018 11:51:28 -0700 Subject: [PATCH] virtcontainers: Remove /dev from the ignored system mounts Since we want to handle certain files in /dev for k8s case, remove /dev from the mounts list that we ignore. Signed-off-by: Archana Shinde --- virtcontainers/mount.go | 2 +- virtcontainers/mount_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/virtcontainers/mount.go b/virtcontainers/mount.go index e4a7dfb27..ba712ac4b 100644 --- a/virtcontainers/mount.go +++ b/virtcontainers/mount.go @@ -18,7 +18,7 @@ import ( var rootfsDir = "rootfs" -var systemMountPrefixes = []string{"/proc", "/dev", "/sys"} +var systemMountPrefixes = []string{"/proc", "/sys"} func isSystemMount(m string) bool { for _, p := range systemMountPrefixes { diff --git a/virtcontainers/mount_test.go b/virtcontainers/mount_test.go index 4795932f5..6818af6d9 100644 --- a/virtcontainers/mount_test.go +++ b/virtcontainers/mount_test.go @@ -31,7 +31,8 @@ func TestIsSystemMount(t *testing.T) { {"/sys/fs/cgroup", true}, {"/sysfoo", false}, {"/home", false}, - {"/dev/block/", true}, + {"/dev/block/", false}, + {"/mnt/dev/foo", false}, } for _, test := range tests {