mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 04:31:28 +00:00
Keep backwards compatibility in kill api.
Return an error when the container is stopped only in api versions equal or greater than 1.20 (docker 1.8). Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-check/check"
|
||||
@@ -87,3 +89,12 @@ func (s *DockerSuite) TestKillWithInvalidSignal(c *check.C) {
|
||||
c.Fatal("Container should be in running state after an invalid signal")
|
||||
}
|
||||
}
|
||||
|
||||
func (s *DockerSuite) TestKillofStoppedContainerAPIPre120(c *check.C) {
|
||||
dockerCmd(c, "run", "--name", "docker-kill-test-api", "-d", "busybox", "top")
|
||||
dockerCmd(c, "stop", "docker-kill-test-api")
|
||||
|
||||
status, _, err := sockRequest("POST", fmt.Sprintf("/v1.19/containers/%s/kill", "docker-kill-test-api"), nil)
|
||||
c.Assert(err, check.IsNil)
|
||||
c.Assert(status, check.Equals, http.StatusNoContent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user