diff --git a/pkg/systemd/quadlet/quadlet.go b/pkg/systemd/quadlet/quadlet.go index 697c7455f9..f652ced092 100644 --- a/pkg/systemd/quadlet/quadlet.go +++ b/pkg/systemd/quadlet/quadlet.go @@ -1651,9 +1651,9 @@ 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]) + shmSize, exists := podUnit.Lookup(PodGroup, KeyShmSize) + if exists { + execStartPre.addf("--shm-size=%s", shmSize) } handlePodmanArgs(podUnit, PodGroup, execStartPre)