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.
@@ -309,11 +309,15 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
}
}
if c.String("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") != "" {
memoryKernel, err = units.RAMInBytes(c.String("kernel-memory"))
if err != nil {
