Skip to content

Commit

Permalink
Change Quadlet Pod Stringkeys map function from lookupAndAddAllStrings
Browse files Browse the repository at this point in the history
to lookupAndAddString to reflect the on the same usage in the other
components.

Update the e2e test.

Signed-off-by: Odilon Sousa <[email protected]>
  • Loading branch information
Odilhao committed Dec 26, 2024
1 parent bf3acc1 commit bec03ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -1632,8 +1632,9 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
stringsKeys := map[string]string{
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 All @@ -1651,11 +1652,6 @@ func ConvertPod(podUnit *parser.UnitFile, name string, unitsInfoMap map[string]*
execStartPre.add("--infra-name", fmt.Sprintf("%s-infra", podName))
execStartPre.add("--name", podName)

shmSize, exists := podUnit.Lookup(PodGroup, KeyShmSize)
if exists {
execStartPre.addf("--shm-size=%s", shmSize)
}

handlePodmanArgs(podUnit, PodGroup, execStartPre)

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

[Pod]
ShmSize=5g

0 comments on commit bec03ee

Please sign in to comment.