mirror of https://github.com/minio/minio.git
fix: parsing v2 and v1 cgroup memory limit (#19153)
Trim the newline at the end of the sysfs memory limit.
This commit is contained in:
parent
40fb3371fa
commit
9a7c7ab2d0
|
|
@ -22,6 +22,7 @@ import (
|
|||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ func cgroupMemLimit() (limit uint64) {
|
|||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
limit, err = strconv.ParseUint(string(buf), 10, 64)
|
||||
limit, err = strconv.ParseUint(strings.TrimSpace(string(buf)), 10, 64)
|
||||
if err != nil {
|
||||
// The kernel can return valid but non integer values
|
||||
// but still, no need to interpret more
|
||||
|
|
|
|||
Loading…
Reference in New Issue