podman-remote stop -time 0 does not work

This patch will allow users to pass in the time 0.
Currently the timeout will take 10 seconds if user passes
in the 0 flag.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2021-03-05 10:30:05 -05:00
parent 0bac30d724
commit d107c37296
2 changed files with 4 additions and 4 deletions

View File

@ -39,11 +39,11 @@ func StopContainer(w http.ResponseWriter, r *http.Request) {
Ignore: query.Ignore,
}
if utils.IsLibpodRequest(r) {
if query.LibpodTimeout > 0 {
if _, found := r.URL.Query()["timeout"]; found {
options.Timeout = &query.LibpodTimeout
}
} else {
if query.DockerTimeout > 0 {
if _, found := r.URL.Query()["t"]; found {
options.Timeout = &query.DockerTimeout
}
}