diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-01 17:17:41 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2022-02-03 14:54:29 -0500 |
commit | cad6459b681dac94801ca63fac61eff1faf3626f (patch) | |
tree | 189a069a522e6e1dc0642411a76b463858e2e29e /pkg/specgenutil | |
parent | 06821627fb6fde0e55d70263469394a0a5299899 (diff) | |
download | podman-cad6459b681dac94801ca63fac61eff1faf3626f.tar.gz podman-cad6459b681dac94801ca63fac61eff1faf3626f.tar.bz2 podman-cad6459b681dac94801ca63fac61eff1faf3626f.zip |
Fix size to match Docker selection
Fixes: https://github.com/containers/podman/issues/13096
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgenutil')
-rw-r--r-- | pkg/specgenutil/specgen.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 8ca7ce4e6..17699a038 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -19,6 +19,7 @@ import ( "github.com/containers/podman/v4/pkg/specgen" systemdDefine "github.com/containers/podman/v4/pkg/systemd/define" "github.com/containers/podman/v4/pkg/util" + "github.com/docker/docker/opts" "github.com/docker/go-units" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" @@ -422,11 +423,12 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions // SHM Size if c.ShmSize != "" { - shmSize, err := units.FromHumanSize(c.ShmSize) - if err != nil { + var m opts.MemBytes + if err := m.Set(c.ShmSize); err != nil { return errors.Wrapf(err, "unable to translate --shm-size") } - s.ShmSize = &shmSize + val := m.Value() + s.ShmSize = &val } if c.Net != nil { |