diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-02-05 10:37:02 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-02-05 10:37:51 -0500 |
commit | 100d2fdcfd37fafba6f27debe7fee1b4899551e8 (patch) | |
tree | bb2122ce2b2f8f69316dc408ac96061645849920 /cmd/podman/shared/create.go | |
parent | 537352cc3ee60373b41481a7f48e65b1978ea5f7 (diff) | |
download | podman-100d2fdcfd37fafba6f27debe7fee1b4899551e8.tar.gz podman-100d2fdcfd37fafba6f27debe7fee1b4899551e8.tar.bz2 podman-100d2fdcfd37fafba6f27debe7fee1b4899551e8.zip |
Special case memory-swap=-1
We document that memory-swap==-1 means unlimited, but currently we
won't allow the user to specify the -1 value.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/shared/create.go')
-rw-r--r-- | cmd/podman/shared/create.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 2f637694b..010c80373 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -309,9 +309,13 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod. } } if c.String("memory-swap") != "" { - memorySwap, err = units.RAMInBytes(c.String("memory-swap")) - if err != nil { - return nil, errors.Wrapf(err, "invalid value for memory-swap") + if c.String("memory-swap") == "-1" { + memorySwap = -1 + } else { + memorySwap, err = units.RAMInBytes(c.String("memory-swap")) + if err != nil { + return nil, errors.Wrapf(err, "invalid value for memory-swap") + } } } if c.String("kernel-memory") != "" { |