Skip to content

Commit

Permalink
Add support to ShmSize in Pods with Quadlet
Browse files Browse the repository at this point in the history
This closes containers#22915
  • Loading branch information
Odilhao committed Dec 23, 2024
1 parent d3cd509 commit e7dde1f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ var (
KeyRemapUidSize: true,
KeyRemapUsers: true,
KeyServiceName: true,
KeyShmSize: true,
KeySubGIDMap: true,
KeySubUIDMap: true,
KeyUIDMap: true,
Expand Down Expand Up @@ -1650,6 +1651,11 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
execStartPre.add("--infra-name", fmt.Sprintf("%s-infra", podName))
execStartPre.add("--name", podName)

shmSize := podUnit.LookupAll(PodGroup, KeyShmSize)
if len(shmSize) > 0 {
execStartPre.addf("--shm-size=%s", shmSize[0])
}

handlePodmanArgs(podUnit, PodGroup, execStartPre)

service.AddCmdline(ServiceGroup, "ExecStartPre", execStartPre.Args)
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/quadlet/shmsize.pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## assert-podman-pre-args "--shm-size=5g"

[Pod]
ShmSize=5g
1 change: 1 addition & 0 deletions test/e2e/quadlet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e7dde1f

Please sign in to comment.