mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-16 02:47:41 +00:00
Docker documents HostConfig.PidsLimit 0 as unlimited, but runc sets pids.max=1 for OCI pids.limit 0. Normalize 0 to -1 when building the OCI spec so native CLI, compat API, and kube play behave consistently. Fixes: https://github.com/podman-container-tools/podman/issues/29826 Signed-off-by: Jan Rodák <hony.com@seznam.cz>
13 lines
276 B
Go
13 lines
276 B
Go
package specgenutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestPidsLimitForOCI(t *testing.T) {
|
|
assert.Equal(t, int64(-1), PidsLimitForOCI(0))
|
|
assert.Equal(t, int64(-1), PidsLimitForOCI(-1))
|
|
assert.Equal(t, int64(2048), PidsLimitForOCI(2048))
|
|
}
|