quadlet: allow empty Entrypoint to clear image default

Setting Entrypoint= (empty value) in a quadlet .container file should
produce --entrypoint "" in the generated podman command, which clears
the image's default entrypoint. Previously this was silently ignored
because lookupAndAddString skips empty values.

Move the Entrypoint key out of the generic stringKeys map and handle
it separately so that an empty value is passed through.

Closes #28213

Signed-off-by: umut-polat <52835619+umut-polat@users.noreply.github.com>
This commit is contained in:
umut-polat committed 2026-03-13 08:14:57 +00:00
1 parent 0794850a55
commit 926f562bd5
4 files changed
+15 -2

No files matched your search

+7 -1
View File
@@ -679,11 +679,17 @@ func ConvertContainer(container *parser.UnitFile, unitsInfoMap map[string]*UnitI
podman.add("--cgroups=split")
}
// Entrypoint needs special handling: an empty value is valid and means
// "clear the image entrypoint" (podman run --entrypoint ""), so it
// cannot go through lookupAndAddString which skips empty values.
if val, ok := container.Lookup(ContainerGroup, KeyEntrypoint); ok {
podman.addf("--entrypoint=%s", val)
}
stringKeys := map[string]string{
KeyTimezone: "--tz",
KeyPidsLimit: "--pids-limit",
KeyShmSize: "--shm-size",
KeyEntrypoint: "--entrypoint",
KeyWorkingDir: "--workdir",
KeyIP: "--ip",
KeyIP6: "--ip6",