|
@@ -5,12 +5,10 @@ package network
|
|
|
import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
- "os"
|
|
|
"testing"
|
|
|
|
|
|
"github.com/docker/docker/api/types"
|
|
|
"github.com/docker/docker/client"
|
|
|
- "github.com/docker/docker/pkg/parsers/kernel"
|
|
|
"gotest.tools/v3/assert/cmp"
|
|
|
"gotest.tools/v3/icmd"
|
|
|
)
|
|
@@ -74,21 +72,3 @@ func IsNetworkNotAvailable(c client.NetworkAPIClient, name string) cmp.Compariso
|
|
|
return cmp.ResultSuccess
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// CheckKernelMajorVersionGreaterOrEqualThen returns whether the kernel version is greater or equal than the one provided
|
|
|
-func CheckKernelMajorVersionGreaterOrEqualThen(kernelVersion int, majorVersion int) bool {
|
|
|
- kv, err := kernel.GetKernelVersion()
|
|
|
- if err != nil {
|
|
|
- return false
|
|
|
- }
|
|
|
- if kv.Kernel < kernelVersion || (kv.Kernel == kernelVersion && kv.Major < majorVersion) {
|
|
|
- return false
|
|
|
- }
|
|
|
- return true
|
|
|
-}
|
|
|
-
|
|
|
-// IsUserNamespace returns whether the user namespace remapping is enabled
|
|
|
-func IsUserNamespace() bool {
|
|
|
- root := os.Getenv("DOCKER_REMAP_ROOT")
|
|
|
- return root != ""
|
|
|
-}
|