diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-02 09:36:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 09:36:45 -0500 |
commit | 72c505a18104a183ad92e3b419f11d31fd37edaa (patch) | |
tree | 8c5a2663af3bd6138514db52f4f9c68107b17093 /pkg/specgenutil/specgen.go | |
parent | c2d0011b723428c622b99cf633439f84c4bf901a (diff) | |
parent | b6fe7d1191ce522e5cfdc4da0c7a40a0834af8b4 (diff) | |
download | podman-72c505a18104a183ad92e3b419f11d31fd37edaa.tar.gz podman-72c505a18104a183ad92e3b419f11d31fd37edaa.tar.bz2 podman-72c505a18104a183ad92e3b419f11d31fd37edaa.zip |
Merge pull request #13107 from rhatdan/shm
Fix size to match Docker selection
Diffstat (limited to 'pkg/specgenutil/specgen.go')
-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 { |