Skip to content

Commit

Permalink
helpers: handle cgroup v2 "max" value
Browse files Browse the repository at this point in the history
when the "max" value is found handle it as math.MaxUint64.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Mar 24, 2021
1 parent cf79551 commit 7bd9ea7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion container/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ func readString(dirpath string, file string) string {

func readUInt64(dirpath string, file string) uint64 {
out := readString(dirpath, file)
if out == "" || out == "max" {
if out == "max" {
return math.MaxUint64
}
if out == "" {
return 0
}

Expand Down

0 comments on commit 7bd9ea7

Please sign in to comment.