Skip to content

Commit

Permalink
cgroups: reuse version check from c/common
Browse files Browse the repository at this point in the history
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
  • Loading branch information
lsm5 authored and rhatdan committed Mar 1, 2024
1 parent 83e0688 commit 3121a9b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
3 changes: 2 additions & 1 deletion info.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
internalUtil "github.com/containers/buildah/internal/util"
putil "github.com/containers/buildah/pkg/util"
"github.com/containers/buildah/util"
"github.com/containers/common/pkg/cgroups"
"github.com/containers/storage"
"github.com/containers/storage/pkg/system"
"github.com/containers/storage/pkg/unshare"
Expand Down Expand Up @@ -50,7 +51,7 @@ func hostInfo() map[string]interface{} {
info["cpus"] = runtime.NumCPU()
info["rootless"] = unshare.IsRootless()

unified, err := util.IsCgroup2UnifiedMode()
unified, err := cgroups.IsCgroup2UnifiedMode()
if err != nil {
logrus.Error(err, "err reading cgroups mode")
}
Expand Down
7 changes: 0 additions & 7 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"path/filepath"
"sort"
"strings"
"sync"
"syscall"

"github.com/containers/buildah/define"
Expand Down Expand Up @@ -376,12 +375,6 @@ func TruncateString(str string, to int) string {
return newStr
}

var (
isUnifiedOnce sync.Once
isUnified bool
isUnifiedErr error
)

// fileExistsAndNotADir - Check to see if a file exists
// and that it is not a directory.
func fileExistsAndNotADir(path string) (bool, error) {
Expand Down
20 changes: 0 additions & 20 deletions util/util_linux.go

This file was deleted.

0 comments on commit 3121a9b

Please sign in to comment.