build(deps): bump github.com/intel/goresctrl from 0.3.0 to 0.5.0
Bumps [github.com/intel/goresctrl](https://github.com/intel/goresctrl) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/intel/goresctrl/releases) - [Commits](https://github.com/intel/goresctrl/compare/v0.3.0...v0.5.0) --- updated-dependencies: - dependency-name: github.com/intel/goresctrl dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
36
vendor/github.com/intel/goresctrl/pkg/cgroups/cgrouppath.go
generated
vendored
36
vendor/github.com/intel/goresctrl/pkg/cgroups/cgrouppath.go
generated
vendored
@@ -15,11 +15,10 @@
|
||||
package cgroups
|
||||
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
goresctrlpath "github.com/intel/goresctrl/pkg/path"
|
||||
)
|
||||
|
||||
//nolint
|
||||
// nolint
|
||||
const (
|
||||
// Tasks is a cgroup's "tasks" entry.
|
||||
Tasks = "tasks"
|
||||
@@ -37,39 +36,18 @@ const (
|
||||
CpusetMems = "cpuset.mems"
|
||||
)
|
||||
|
||||
var (
|
||||
// mount is the parent directory for per-controller cgroupfs mounts.
|
||||
mountDir = "/sys/fs/cgroup"
|
||||
// v2Dir is the parent directory for per-controller cgroupfs mounts.
|
||||
v2Dir = path.Join(mountDir, "unified")
|
||||
// KubeletRoot is the --cgroup-root option the kubelet is running with.
|
||||
KubeletRoot = ""
|
||||
)
|
||||
const cgroupBasePath = "sys/fs/cgroup"
|
||||
|
||||
// GetMountDir returns the common mount point for cgroup v1 controllers.
|
||||
func GetMountDir() string {
|
||||
return mountDir
|
||||
}
|
||||
|
||||
// SetMountDir sets the common mount point for the cgroup v1 controllers.
|
||||
func SetMountDir(dir string) {
|
||||
v2, _ := filepath.Rel(mountDir, v2Dir)
|
||||
mountDir = dir
|
||||
if v2 != "" {
|
||||
v2Dir = path.Join(mountDir, v2)
|
||||
}
|
||||
return cgroupPath()
|
||||
}
|
||||
|
||||
// GetV2Dir returns the cgroup v2 unified mount directory.
|
||||
func GetV2Dir() string {
|
||||
return v2Dir
|
||||
return cgroupPath("unified")
|
||||
}
|
||||
|
||||
// SetV2Dir sets the unified cgroup v2 mount directory.
|
||||
func SetV2Dir(dir string) {
|
||||
if dir[0] == '/' {
|
||||
v2Dir = dir
|
||||
} else {
|
||||
v2Dir = path.Join(mountDir, v2Dir)
|
||||
}
|
||||
func cgroupPath(elems ...string) string {
|
||||
return goresctrlpath.Path(append([]string{cgroupBasePath}, elems...)...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user