Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to ShmSize in Pods with Quadlet #24899

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/source/markdown/podman-systemd.unit.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 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 @@ -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",
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
Loading