Skip to content

Commit 779aeca

Browse files
kolyshkinarsenalzp
authored andcommitted
podman run: fix --pids-limit -1 wrt runc
Since commit c25cc72 ("Allow a value of -1 to set unlimited pids limit") podman converts the pids-limit value of -1 to 0 for OCI spec. Unfortunately, different runtimes (crun and runc) treat pids.limit=0 differently, and the runtime-spec definition is somewhat vague (see [1]). Long term fix belongs to runtime-spec and then runtimes should follow it. Short term fix is do not convert -1 to 0 (as all runtimes treat -1 as unlimited). [NO NEW TESTS NEEDED] -- this is covered by test added in commit 553e53d. Fixes: https://issues.redhat.com/browse/RHEL-80973 [1]: opencontainers/runc#4014 (comment) Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 0063b4b commit 779aeca

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

cmd/podman/containers/create.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ func replaceContainer(name string) error {
212212
func createOrUpdateFlags(cmd *cobra.Command, vals *entities.ContainerCreateOptions) error {
213213
if cmd.Flags().Changed("pids-limit") {
214214
val := cmd.Flag("pids-limit").Value.String()
215-
// Convert -1 to 0, so that -1 maps to unlimited pids limit
216-
if val == "-1" {
217-
val = "0"
218-
}
219215
pidsLimit, err := strconv.ParseInt(val, 10, 32)
220216
if err != nil {
221217
return err

0 commit comments

Comments
 (0)