From bb82839492b5226c8c5b04906a05da311177f713 Mon Sep 17 00:00:00 2001 From: baude Date: Wed, 10 Feb 2021 13:39:09 -0600 Subject: Display correct value for unlimited ulimit When doing a container inspect on a container with unlimited ulimits, the value should be -1. But because the OCI spec requires the ulimit value to be uint64, we were displaying the inspect values as a uint64 as well. Simple change to display as an int64. Fixes: #9303 Signed-off-by: baude --- libpod/container_inspect.go | 4 ++-- libpod/define/container_inspect.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libpod') diff --git a/libpod/container_inspect.go b/libpod/container_inspect.go index ac7eae56b..cc8b75472 100644 --- a/libpod/container_inspect.go +++ b/libpod/container_inspect.go @@ -864,8 +864,8 @@ func (c *Container) generateInspectContainerHostConfig(ctrSpec *spec.Spec, named for _, limit := range ctrSpec.Process.Rlimits { newLimit := define.InspectUlimit{} newLimit.Name = limit.Type - newLimit.Soft = limit.Soft - newLimit.Hard = limit.Hard + newLimit.Soft = int64(limit.Soft) + newLimit.Hard = int64(limit.Hard) hostConfig.Ulimits = append(hostConfig.Ulimits, newLimit) } } diff --git a/libpod/define/container_inspect.go b/libpod/define/container_inspect.go index 9a93e2ffd..7d4b8a46f 100644 --- a/libpod/define/container_inspect.go +++ b/libpod/define/container_inspect.go @@ -120,9 +120,9 @@ type InspectUlimit struct { // Name is the name (type) of the ulimit. Name string `json:"Name"` // Soft is the soft limit that will be applied. - Soft uint64 `json:"Soft"` + Soft int64 `json:"Soft"` // Hard is the hard limit that will be applied. - Hard uint64 `json:"Hard"` + Hard int64 `json:"Hard"` } // InspectDevice is a single device that will be mounted into the container. -- cgit v1.2.3-54-g00ecf