diff --git a/integration/network/dns_test.go b/integration/network/dns_test.go index f8037f0184..c4a50fe9a2 100644 --- a/integration/network/dns_test.go +++ b/integration/network/dns_test.go @@ -16,7 +16,7 @@ import ( func TestDaemonDNSFallback(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run") skip.If(t, testEnv.DaemonInfo.OSType != "linux") - skip.If(t, IsUserNamespace()) + skip.If(t, testEnv.IsUserNamespace) d := daemon.New(t) d.StartWithBusybox(t, "-b", "none", "--dns", "127.127.127.1", "--dns", "8.8.8.8") diff --git a/integration/network/helpers.go b/integration/network/helpers.go index e7b087d9cd..c5a1ffdc2b 100644 --- a/integration/network/helpers.go +++ b/integration/network/helpers.go @@ -5,7 +5,6 @@ package network import ( "context" "fmt" - "os" "testing" "github.com/docker/docker/api/types" @@ -86,9 +85,3 @@ func CheckKernelMajorVersionGreaterOrEqualThen(kernelVersion int, majorVersion i } return true } - -// IsUserNamespace returns whether the user namespace remapping is enabled -func IsUserNamespace() bool { - root := os.Getenv("DOCKER_REMAP_ROOT") - return root != "" -} diff --git a/integration/network/helpers_windows.go b/integration/network/helpers_windows.go index 0652c05dcf..35121fb200 100644 --- a/integration/network/helpers_windows.go +++ b/integration/network/helpers_windows.go @@ -3,7 +3,6 @@ package network import ( "context" "fmt" - "os" "github.com/docker/docker/api/types" "github.com/docker/docker/client" @@ -41,9 +40,3 @@ func IsNetworkNotAvailable(c client.NetworkAPIClient, name string) cmp.Compariso return cmp.ResultSuccess } } - -// IsUserNamespace returns whether the user namespace remapping is enabled -func IsUserNamespace() bool { - root := os.Getenv("DOCKER_REMAP_ROOT") - return root != "" -} diff --git a/integration/network/network_test.go b/integration/network/network_test.go index 66fdcfe26a..ec0546aa0e 100644 --- a/integration/network/network_test.go +++ b/integration/network/network_test.go @@ -23,7 +23,7 @@ import ( func TestRunContainerWithBridgeNone(t *testing.T) { skip.If(t, testEnv.IsRemoteDaemon, "cannot start daemon on remote test run") skip.If(t, testEnv.DaemonInfo.OSType != "linux") - skip.If(t, IsUserNamespace()) + skip.If(t, testEnv.IsUserNamespace) skip.If(t, testEnv.IsRootless, "rootless mode has different view of network") d := daemon.New(t)