diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-30 15:14:28 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-30 15:14:28 -0400 |
commit | 5c2204b5cea9f310d0c06f181cfa64b6658823e6 (patch) | |
tree | 9ecc2baec9b21d0d56e0a2e05c3b671ed7b61196 /cmd/podman | |
parent | 1f3e2ed74ff833a25fcf7b0f796b6a9569cf362d (diff) | |
parent | c25cc7230fa1d54903728626584d30808539cc04 (diff) | |
download | podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.tar.gz podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.tar.bz2 podman-5c2204b5cea9f310d0c06f181cfa64b6658823e6.zip |
Merge pull request #11794 from umohnani8/pid
Allow a value of -1 to set unlimited pids limit
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/create.go | 2 | ||||
-rw-r--r-- | cmd/podman/containers/create.go | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index a969e17e9..e490fa121 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -421,7 +421,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, pidsLimitFlagName := "pids-limit" createFlags.Int64( pidsLimitFlagName, pidsLimit(), - "Tune container pids limit (set 0 for unlimited, -1 for server defaults)", + "Tune container pids limit (set -1 for unlimited)", ) _ = cmd.RegisterFlagCompletionFunc(pidsLimitFlagName, completion.AutocompleteNone) diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index 2593b4c44..bfeeb7ebe 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -235,6 +235,10 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra if c.Flags().Changed("pids-limit") { val := c.Flag("pids-limit").Value.String() + // Convert -1 to 0, so that -1 maps to unlimited pids limit + if val == "-1" { + val = "0" + } pidsLimit, err := strconv.ParseInt(val, 10, 32) if err != nil { return vals, err |