Fixed #27120: Pod Quadlet can configure podman pod stop --time

Signed-off-by: ByoungUk Lee <nimdrak@gmail.com>
This commit is contained in:
ByoungUk Lee
2025-10-08 07:50:47 +00:00
parent 7fecff5c29
commit d1c43e3ae8
3 changed files with 15 additions and 1 deletions

View File

@@ -485,6 +485,7 @@ var (
KeyRemapUsers: true,
KeyServiceName: true,
KeyShmSize: true,
KeyStopTimeout: true,
KeySubGIDMap: true,
KeySubUIDMap: true,
KeyUIDMap: true,
@@ -1552,9 +1553,13 @@ func ConvertPod(podUnit *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
execStop := createBasePodmanCommand(podUnit, PodGroup)
execStop.add("pod", "stop")
stopTimeout := "10"
if value, ok := podUnit.Lookup(PodGroup, KeyStopTimeout); ok {
stopTimeout = value
}
execStop.add(
"--ignore",
"--time=10",
fmt.Sprintf("--time=%s", stopTimeout),
podName,
)
service.AddCmdline(ServiceGroup, "ExecStop", execStop.Args)

View File

@@ -0,0 +1,8 @@
## assert-podman-stop-args --time=20
[Unit]
Description=A pod with a custom stop timeout
[Pod]
PodName=test-pod
StopTimeout=20

View File

@@ -1093,6 +1093,7 @@ BOGUS=foo
Entry("Pod - Remap keep-id", "remap-keep-id.pod"),
Entry("Pod - Remap manual", "remap-manual.pod"),
Entry("Pod - Shm Size", "shmsize.pod"),
Entry("Pod - StopTimeout", "stoptimeout.pod"),
Entry("Pod - Service Environment", "service-environment.pod"),
)