mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
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>
This commit is contained in:
@ -309,9 +309,13 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if c.String("memory-swap") != "" {
|
if c.String("memory-swap") != "" {
|
||||||
memorySwap, err = units.RAMInBytes(c.String("memory-swap"))
|
if c.String("memory-swap") == "-1" {
|
||||||
if err != nil {
|
memorySwap = -1
|
||||||
return nil, errors.Wrapf(err, "invalid value for memory-swap")
|
} 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") != "" {
|
if c.String("kernel-memory") != "" {
|
||||||
|
Reference in New Issue
Block a user