From 2cd9f72151c91e86843ccd70acab66a1ab5821dc Mon Sep 17 00:00:00 2001 From: Odilon Sousa Date: Thu, 26 Dec 2024 00:00:37 -0300 Subject: [PATCH] Change Quadlet Pod Stringkeys map function from lookupAndAddAllStrings to lookupAndAddString to reflect the on the same usage in the other components. Update the e2e test. Signed-off-by: Odilon Sousa --- pkg/systemd/quadlet/quadlet.go | 12 ++++-------- test/e2e/quadlet/shmsize.pod | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index f652ced092..1c01679270 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -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", @@ -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) diff --git a/test/e2e/quadlet/shmsize.pod b/test/e2e/quadlet/shmsize.pod index a19ffb8c4c..11ae7cf982 100644 --- a/test/e2e/quadlet/shmsize.pod +++ b/test/e2e/quadlet/shmsize.pod @@ -1,4 +1,4 @@ -## assert-podman-pre-args "--shm-size=5g" +## assert-podman-pre-args "--shm-size" "5g" [Pod] ShmSize=5g