Skip to content

Commit

Permalink
Update Stringkeys map function to lookupAndAddString.
Browse files Browse the repository at this point in the history
Signed-off-by: Odilon Sousa <[email protected]>
  • Loading branch information
Odilhao committed Dec 26, 2024
1 parent bf3acc1 commit d33ed1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions pkg/systemd/quadlet/quadlet.go
Original file line number Diff line number Diff line change
Expand Up @@ -1630,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 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 d33ed1f

Please sign in to comment.