mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
podman run --memory=0 ... should not set memory limit
On Docker this is ignored, and it should be on Podman as well. This is documented in the man page. Fixes: https://github.com/containers/podman/issues/12002 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -133,12 +133,14 @@ func getMemoryLimits(s *specgen.SpecGenerator, c *entities.ContainerCreateOption
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "invalid value for memory")
|
||||
}
|
||||
memory.Limit = &ml
|
||||
if c.MemorySwap == "" {
|
||||
limit := 2 * ml
|
||||
memory.Swap = &(limit)
|
||||
if ml > 0 {
|
||||
memory.Limit = &ml
|
||||
if c.MemorySwap == "" {
|
||||
limit := 2 * ml
|
||||
memory.Swap = &(limit)
|
||||
}
|
||||
hasLimits = true
|
||||
}
|
||||
hasLimits = true
|
||||
}
|
||||
if m := c.MemoryReservation; len(m) > 0 {
|
||||
mr, err := units.RAMInBytes(m)
|
||||
|
Reference in New Issue
Block a user