diff --git a/docs/source/markdown/podman-systemd.unit.5.md b/docs/source/markdown/podman-systemd.unit.5.md index c0ef6e021c..f95a1d45bb 100644 --- a/docs/source/markdown/podman-systemd.unit.5.md +++ b/docs/source/markdown/podman-systemd.unit.5.md @@ -953,6 +953,7 @@ Valid options for `[Pod]` are listed below: | PodName=name | --name=name | | PublishPort=8080:80 | --publish 8080:80 | | ServiceName=name | Name the systemd unit `name.service` | +| ShmSize=100m | --shm-size=100m | | SubGIDMap=gtest | --subgidname=gtest | | SubUIDMap=utest | --subuidname=utest | | UIDMap=0:10000:10 | --uidmap=0:10000:10 | @@ -1092,6 +1093,12 @@ Setting this key overrides this behavior by instructing Quadlet to use the provi Note, the name should not include the `.service` file extension +### `ShmSize=` + +Size of /dev/shm. + +This is equivalent to the Podman `--shm-size` option and generally has the form `number[unit]` + ### `SubGIDMap=` Create the pod in a new user namespace using the map with name in the /etc/subgid file. diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 79f65c42f8..1c01679270 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -413,6 +413,7 @@ var ( KeyRemapUidSize: true, KeyRemapUsers: true, KeyServiceName: true, + KeyShmSize: true, KeySubGIDMap: true, KeySubUIDMap: true, KeyUIDMap: true, @@ -1629,10 +1630,11 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]* } stringsKeys := map[string]string{ - KeyIP: "--ip", - KeyIP6: "--ip6", + KeyIP: "--ip", + KeyIP6: "--ip6", + KeyShmSize: "--shm-size", } - lookupAndAddAllStrings(podUnit, PodGroup, stringsKeys, execStartPre) + lookupAndAddString(podUnit, PodGroup, stringsKeys, execStartPre) allStringsKeys := map[string]string{ KeyNetworkAlias: "--network-alias", diff --git a/test/e2e/quadlet/shmsize.pod b/test/e2e/quadlet/shmsize.pod new file mode 100644 index 0000000000..11ae7cf982 --- /dev/null +++ b/test/e2e/quadlet/shmsize.pod @@ -0,0 +1,4 @@ +## assert-podman-pre-args "--shm-size" "5g" + +[Pod] +ShmSize=5g diff --git a/test/e2e/quadlet_test.go b/test/e2e/quadlet_test.go index c0e988d2c2..2a85d8dca9 100644 --- a/test/e2e/quadlet_test.go +++ b/test/e2e/quadlet_test.go @@ -1042,6 +1042,7 @@ BOGUS=foo Entry("Pod - Remap auto2", "remap-auto2.pod"), Entry("Pod - Remap keep-id", "remap-keep-id.pod"), Entry("Pod - Remap manual", "remap-manual.pod"), + Entry("Pod - Shm Size", "shmsize.pod"), ) DescribeTable("Running expected warning quadlet test case",