From b4f5a246a24569cc72b109c3477e867e503d14cb Mon Sep 17 00:00:00 2001 From: Mikhail Khachayants Date: Sat, 27 Aug 2022 20:38:21 +0300 Subject: remove github.com/docker/libnetwork dependency Code from this dependency was replaced with a simple version. As a result Podman's memory consumption has been reduced by ~10%. [NO NEW TESTS NEEDED] Signed-off-by: Mikhail Khachayants --- pkg/specgenutil/specgen.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg') diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 8c2c59fed..d0e09fe72 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -20,7 +20,6 @@ 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" ) @@ -461,11 +460,12 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions // SHM Size if c.ShmSize != "" { - var m opts.MemBytes - if err := m.Set(c.ShmSize); err != nil { + val, err := units.RAMInBytes(c.ShmSize) + + if err != nil { return fmt.Errorf("unable to translate --shm-size: %w", err) } - val := m.Value() + s.ShmSize = &val } -- cgit v1.2.3-54-g00ecf