fix e2e tests for cgroups
This commit is contained in:
commit
8621dfc66d
3 changed files with 100 additions and 3 deletions
|
|
@ -38,7 +38,7 @@ import (
|
|||
func NumCPU() int {
|
||||
cpus := runtime.NumCPU()
|
||||
|
||||
cgroupVersion := getCgroupVersion()
|
||||
cgroupVersion := GetCgroupVersion()
|
||||
cpuQuota := int64(-1)
|
||||
cpuPeriod := int64(-1)
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ func NumCPU() int {
|
|||
return int(math.Ceil(float64(cpuQuota) / float64(cpuPeriod)))
|
||||
}
|
||||
|
||||
func getCgroupVersion() int64 {
|
||||
func GetCgroupVersion() int64 {
|
||||
// /sys/fs/cgroup/cgroup.controllers will not exist with cgroupsv1
|
||||
if _, err := os.Stat("/sys/fs/cgroup/cgroup.controllers"); err == nil {
|
||||
return 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue