summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-02-01 17:17:41 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2022-02-01 17:19:19 -0500
commitb6fe7d1191ce522e5cfdc4da0c7a40a0834af8b4 (patch)
treea4469850421a0aaafc329f26b5c26071711546cf /pkg
parent6f491e21aa291ac0e9cbda5f41e7dc8b87fe160c (diff)
downloadpodman-b6fe7d1191ce522e5cfdc4da0c7a40a0834af8b4.tar.gz
podman-b6fe7d1191ce522e5cfdc4da0c7a40a0834af8b4.tar.bz2
podman-b6fe7d1191ce522e5cfdc4da0c7a40a0834af8b4.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')
-rw-r--r--pkg/specgenutil/specgen.go8
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 {