From cd4428dfdd1f9dea212444cdb7e746fc36e3745a Mon Sep 17 00:00:00 2001 From: Pablo Caderno Date: Fri, 13 May 2022 09:05:42 +1000 Subject: [PATCH] fix: removed unused code Signed-off-by: Pablo Caderno --- pkg/drivers/kic/oci/cgroups_linux.go | 11 ----------- pkg/drivers/kic/oci/cgroups_other.go | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/pkg/drivers/kic/oci/cgroups_linux.go b/pkg/drivers/kic/oci/cgroups_linux.go index c31c87284c..8d077f4c11 100644 --- a/pkg/drivers/kic/oci/cgroups_linux.go +++ b/pkg/drivers/kic/oci/cgroups_linux.go @@ -22,23 +22,12 @@ import ( "fmt" "os" "path" - "syscall" "github.com/opencontainers/runc/libcontainer/cgroups" - "golang.org/x/sys/unix" "k8s.io/klog/v2" ) -// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode. -func IsCgroup2UnifiedMode() (bool, error) { - var st syscall.Statfs_t - if err := syscall.Statfs("/sys/fs/cgroup", &st); err != nil { - return false, err - } - return st.Type == unix.CGROUP2_SUPER_MAGIC, nil -} - // findCgroupMountpoints returns the cgroups mount point // defined in docker engine engine/pkg/sysinfo/sysinfo_linux.go func findCgroupMountpoints() (map[string]string, error) { diff --git a/pkg/drivers/kic/oci/cgroups_other.go b/pkg/drivers/kic/oci/cgroups_other.go index 55dc8b8175..db124317a6 100644 --- a/pkg/drivers/kic/oci/cgroups_other.go +++ b/pkg/drivers/kic/oci/cgroups_other.go @@ -18,17 +18,6 @@ limitations under the License. package oci -import ( - "runtime" - - "github.com/pkg/errors" -) - -// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode. -func IsCgroup2UnifiedMode() (bool, error) { - return false, errors.Errorf("Not supported on %s", runtime.GOOS) -} - func HasMemoryCgroup() bool { return true }