mirror of
https://github.com/containers/podman.git
synced 2025-11-29 17:48:05 +08:00
Fixed #27120: Pod Quadlet can configure podman pod stop --time
Signed-off-by: ByoungUk Lee <nimdrak@gmail.com>
This commit is contained in:
@@ -485,6 +485,7 @@ var (
|
|||||||
KeyRemapUsers: true,
|
KeyRemapUsers: true,
|
||||||
KeyServiceName: true,
|
KeyServiceName: true,
|
||||||
KeyShmSize: true,
|
KeyShmSize: true,
|
||||||
|
KeyStopTimeout: true,
|
||||||
KeySubGIDMap: true,
|
KeySubGIDMap: true,
|
||||||
KeySubUIDMap: true,
|
KeySubUIDMap: true,
|
||||||
KeyUIDMap: true,
|
KeyUIDMap: true,
|
||||||
@@ -1552,9 +1553,13 @@ func ConvertPod(podUnit *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
|
|||||||
|
|
||||||
execStop := createBasePodmanCommand(podUnit, PodGroup)
|
execStop := createBasePodmanCommand(podUnit, PodGroup)
|
||||||
execStop.add("pod", "stop")
|
execStop.add("pod", "stop")
|
||||||
|
stopTimeout := "10"
|
||||||
|
if value, ok := podUnit.Lookup(PodGroup, KeyStopTimeout); ok {
|
||||||
|
stopTimeout = value
|
||||||
|
}
|
||||||
execStop.add(
|
execStop.add(
|
||||||
"--ignore",
|
"--ignore",
|
||||||
"--time=10",
|
fmt.Sprintf("--time=%s", stopTimeout),
|
||||||
podName,
|
podName,
|
||||||
)
|
)
|
||||||
service.AddCmdline(ServiceGroup, "ExecStop", execStop.Args)
|
service.AddCmdline(ServiceGroup, "ExecStop", execStop.Args)
|
||||||
|
|||||||
8
test/e2e/quadlet/stoptimeout.pod
Normal file
8
test/e2e/quadlet/stoptimeout.pod
Normal 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
|
||||||
@@ -1093,6 +1093,7 @@ BOGUS=foo
|
|||||||
Entry("Pod - Remap keep-id", "remap-keep-id.pod"),
|
Entry("Pod - Remap keep-id", "remap-keep-id.pod"),
|
||||||
Entry("Pod - Remap manual", "remap-manual.pod"),
|
Entry("Pod - Remap manual", "remap-manual.pod"),
|
||||||
Entry("Pod - Shm Size", "shmsize.pod"),
|
Entry("Pod - Shm Size", "shmsize.pod"),
|
||||||
|
Entry("Pod - StopTimeout", "stoptimeout.pod"),
|
||||||
Entry("Pod - Service Environment", "service-environment.pod"),
|
Entry("Pod - Service Environment", "service-environment.pod"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user