mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Add support for passing container stop timeout as -1 (infinite)
Compat api for containers/stop should take -1 value Add support for `podman stop --time -1` Add support for `podman restart --time -1` Add support for `podman rm --time -1` Add support for `podman pod stop --time -1` Add support for `podman pod rm --time -1` Add support for `podman volume rm --time -1` Add support for `podman network rm --time -1` Fixes: https://github.com/containers/podman/issues/17542 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -648,3 +648,11 @@ func ParseRestartPolicy(policy string) (string, uint, error) {
|
||||
}
|
||||
return policyType, retriesUint, nil
|
||||
}
|
||||
|
||||
// ConvertTimeout converts negative timeout to MaxInt, which indicates approximately infinity, waiting to stop containers
|
||||
func ConvertTimeout(timeout int) uint {
|
||||
if timeout < 0 {
|
||||
return math.MaxInt
|
||||
}
|
||||
return uint(timeout)
|
||||
}
|
||||
|
Reference in New Issue
Block a user