summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-22 12:37:25 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-23 18:05:02 +0200
commit2fd6a84c09c4361c16f0bfe086dd4a190c5635b3 (patch)
tree56faf57f5a22ef7005cab40052b499ec4a8ce640 /cmd/podman/common
parentd98b6f4232ba1ba7475e255fcfad65313bfe70c0 (diff)
downloadpodman-2fd6a84c09c4361c16f0bfe086dd4a190c5635b3.tar.gz
podman-2fd6a84c09c4361c16f0bfe086dd4a190c5635b3.tar.bz2
podman-2fd6a84c09c4361c16f0bfe086dd4a190c5635b3.zip
specgen: do not always set shmsize
if it wasn't overriden on the CLI, leave it undefined. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/create.go3
-rw-r--r--cmd/podman/common/specgen.go10
2 files changed, 8 insertions, 5 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index bdf762ed7..e5ee76390 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -394,8 +394,9 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"security-opt", containerConfig.SecurityOptions(),
"Security Options",
)
+ shmSize := ""
createFlags.StringVar(
- &cf.ShmSize,
+ &shmSize,
"shm-size", containerConfig.ShmSize(),
"Size of /dev/shm "+sizeWithUnitFormat,
)
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 10ae0bb2d..994c5367e 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -403,11 +403,13 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
}
// SHM Size
- shmSize, err := units.FromHumanSize(c.ShmSize)
- if err != nil {
- return errors.Wrapf(err, "unable to translate --shm-size")
+ if c.ShmSize != "" {
+ shmSize, err := units.FromHumanSize(c.ShmSize)
+ if err != nil {
+ return errors.Wrapf(err, "unable to translate --shm-size")
+ }
+ s.ShmSize = &shmSize
}
- s.ShmSize = &shmSize
s.HostAdd = c.Net.AddHosts
s.UseImageResolvConf = c.Net.UseImageResolvConf
s.DNSServers = c.Net.DNSServers