summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-06 18:51:05 +0100
committerGitHub <noreply@github.com>2020-02-06 18:51:05 +0100
commit62111bceb7dab4fc51760b86f762df3716f296fc (patch)
tree20de35390eb2c00df3ebc396d0944a3e054c006e
parentf2fe37ea67771a5e682759aca478570b9bb075d4 (diff)
parent100d2fdcfd37fafba6f27debe7fee1b4899551e8 (diff)
downloadpodman-62111bceb7dab4fc51760b86f762df3716f296fc.tar.gz
podman-62111bceb7dab4fc51760b86f762df3716f296fc.tar.bz2
podman-62111bceb7dab4fc51760b86f762df3716f296fc.zip
Merge pull request #5098 from rhatdan/memory-swap
Special case memory-swap=-1
-rw-r--r--cmd/podman/shared/create.go10
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") != "" {