summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/api/handlers/compat/containers_stop.go4
-rw-r--r--test/e2e/stop_test.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/containers_stop.go b/pkg/api/handlers/compat/containers_stop.go
index 0526865b9..3ae223693 100644
--- a/pkg/api/handlers/compat/containers_stop.go
+++ b/pkg/api/handlers/compat/containers_stop.go
@@ -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
}
}
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go
index dd264eb0d..d6d58c94c 100644
--- a/test/e2e/stop_test.go
+++ b/test/e2e/stop_test.go
@@ -150,7 +150,7 @@ var _ = Describe("Podman stop", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"stop", "--time", "1", "test4"})
+ session = podmanTest.Podman([]string{"stop", "--time", "0", "test4"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
output := session.OutputToString()
@@ -166,7 +166,7 @@ var _ = Describe("Podman stop", func() {
session := podmanTest.Podman([]string{"run", "-d", "--name", "test5", ALPINE, "sleep", "100"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"stop", "--timeout", "1", "test5"})
+ session = podmanTest.Podman([]string{"stop", "--timeout", "0", "test5"})
// Without timeout container stops in 10 seconds
// If not stopped in 5 seconds, then --timeout did not work
session.Wait(5)