From c0f801c0c432fca0fca9cef79e2fd7921d0d8c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 26 Jul 2021 08:11:41 +0200 Subject: [PATCH] rootless: RunningInUserNS() is now part of userns namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously part of the "system" namespace, the RunningInUserNS() has been moved to the "userns" namespace. Signed-off-by: Fabiano FidĂȘncio --- src/runtime/virtcontainers/pkg/rootless/rootless.go | 4 ++-- src/runtime/virtcontainers/pkg/rootless/rootless_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/virtcontainers/pkg/rootless/rootless.go b/src/runtime/virtcontainers/pkg/rootless/rootless.go index 507549fa2a..dc69f43eb0 100644 --- a/src/runtime/virtcontainers/pkg/rootless/rootless.go +++ b/src/runtime/virtcontainers/pkg/rootless/rootless.go @@ -30,7 +30,7 @@ import ( "sync" "github.com/containernetworking/plugins/pkg/ns" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) @@ -78,7 +78,7 @@ func isRootlessFunc() bool { if os.Geteuid() != 0 { return true } - if system.RunningInUserNS() { + if userns.RunningInUserNS() { return true } SetRootless(false) diff --git a/src/runtime/virtcontainers/pkg/rootless/rootless_test.go b/src/runtime/virtcontainers/pkg/rootless/rootless_test.go index 0933f645a8..2a7f434462 100644 --- a/src/runtime/virtcontainers/pkg/rootless/rootless_test.go +++ b/src/runtime/virtcontainers/pkg/rootless/rootless_test.go @@ -9,7 +9,7 @@ import ( "os" "testing" - "github.com/opencontainers/runc/libcontainer/system" + "github.com/opencontainers/runc/libcontainer/userns" "github.com/stretchr/testify/assert" ) @@ -21,7 +21,7 @@ func TestIsRootless(t *testing.T) { if os.Getuid() != 0 { rootless = true } else { - rootless = system.RunningInUserNS() + rootless = userns.RunningInUserNS() } assert.Equal(rootless, isRootlessFunc())