mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update request.* signature to remove the host
99.9% of use case for request call are using daemonHost. This makes it default and adds a `request.DoOnHost` function to be able to specify the host for specific, more complex use cases. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
3cfc3e30a8
commit
b11ba1231e
17 changed files with 96 additions and 93 deletions
|
@ -16,7 +16,7 @@ import (
|
|||
func (s *DockerSuite) TestAPIStatsContainerGetMemoryLimit(c *check.C) {
|
||||
testRequires(c, DaemonIsLinux, memoryLimitSupport)
|
||||
|
||||
resp, body, err := request.Get(daemonHost(), "/info", request.JSON)
|
||||
resp, body, err := request.Get("/info", request.JSON)
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(resp.StatusCode, checker.Equals, http.StatusOK)
|
||||
var info types.Info
|
||||
|
@ -29,7 +29,7 @@ func (s *DockerSuite) TestAPIStatsContainerGetMemoryLimit(c *check.C) {
|
|||
dockerCmd(c, "run", "-d", "--name", conName, "busybox", "top")
|
||||
c.Assert(waitRun(conName), checker.IsNil)
|
||||
|
||||
resp, body, err = request.Get(daemonHost(), fmt.Sprintf("/containers/%s/stats?stream=false", conName))
|
||||
resp, body, err = request.Get(fmt.Sprintf("/containers/%s/stats?stream=false", conName))
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(resp.StatusCode, checker.Equals, http.StatusOK)
|
||||
c.Assert(resp.Header.Get("Content-Type"), checker.Equals, "application/json")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue