integration-cli: remove deprecated daemonHost() utility
| ... | ... |
@@ -26,7 +26,7 @@ func (s *DockerSuite) TestGetContainersAttachWebsocket(c *check.C) {
|
| 26 | 26 |
testRequires(c, DaemonIsLinux) |
| 27 | 27 |
out, _ := dockerCmd(c, "run", "-dit", "busybox", "cat") |
| 28 | 28 |
|
| 29 |
- rwc, err := request.SockConn(time.Duration(10*time.Second), daemonHost()) |
|
| 29 |
+ rwc, err := request.SockConn(time.Duration(10*time.Second), request.DaemonHost()) |
|
| 30 | 30 |
c.Assert(err, checker.IsNil) |
| 31 | 31 |
|
| 32 | 32 |
cleanedContainerID := strings.TrimSpace(out) |
| ... | ... |
@@ -141,12 +141,12 @@ func (s *DockerSuite) TestPostContainersAttach(c *check.C) {
|
| 141 | 141 |
cid, _ := dockerCmd(c, "run", "-di", "busybox", "cat") |
| 142 | 142 |
cid = strings.TrimSpace(cid) |
| 143 | 143 |
// Attach to the container's stdout stream. |
| 144 |
- conn, br, err := sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", daemonHost())
|
|
| 144 |
+ conn, br, err := sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", request.DaemonHost())
|
|
| 145 | 145 |
c.Assert(err, checker.IsNil) |
| 146 | 146 |
// Check if the data from stdout can be received. |
| 147 | 147 |
expectSuccess(conn, br, "stdout", false) |
| 148 | 148 |
// Attach to the container's stderr stream. |
| 149 |
- conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", daemonHost())
|
|
| 149 |
+ conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", request.DaemonHost())
|
|
| 150 | 150 |
c.Assert(err, checker.IsNil) |
| 151 | 151 |
// Since the container only emits stdout, attaching to stderr should return nothing. |
| 152 | 152 |
expectTimeout(conn, br, "stdout") |
| ... | ... |
@@ -154,10 +154,10 @@ func (s *DockerSuite) TestPostContainersAttach(c *check.C) {
|
| 154 | 154 |
// Test the similar functions of the stderr stream. |
| 155 | 155 |
cid, _ = dockerCmd(c, "run", "-di", "busybox", "/bin/sh", "-c", "cat >&2") |
| 156 | 156 |
cid = strings.TrimSpace(cid) |
| 157 |
- conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", daemonHost())
|
|
| 157 |
+ conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", request.DaemonHost())
|
|
| 158 | 158 |
c.Assert(err, checker.IsNil) |
| 159 | 159 |
expectSuccess(conn, br, "stderr", false) |
| 160 |
- conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", daemonHost())
|
|
| 160 |
+ conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", request.DaemonHost())
|
|
| 161 | 161 |
c.Assert(err, checker.IsNil) |
| 162 | 162 |
expectTimeout(conn, br, "stderr") |
| 163 | 163 |
|
| ... | ... |
@@ -165,12 +165,12 @@ func (s *DockerSuite) TestPostContainersAttach(c *check.C) {
|
| 165 | 165 |
cid, _ = dockerCmd(c, "run", "-dit", "busybox", "/bin/sh", "-c", "cat >&2") |
| 166 | 166 |
cid = strings.TrimSpace(cid) |
| 167 | 167 |
// Attach to stdout only. |
| 168 |
- conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", daemonHost())
|
|
| 168 |
+ conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stdout=1", nil, "text/plain", request.DaemonHost())
|
|
| 169 | 169 |
c.Assert(err, checker.IsNil) |
| 170 | 170 |
expectSuccess(conn, br, "stdout", true) |
| 171 | 171 |
|
| 172 | 172 |
// Attach without stdout stream. |
| 173 |
- conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", daemonHost())
|
|
| 173 |
+ conn, br, err = sockRequestHijack("POST", "/containers/"+cid+"/attach?stream=1&stdin=1&stderr=1", nil, "text/plain", request.DaemonHost())
|
|
| 174 | 174 |
c.Assert(err, checker.IsNil) |
| 175 | 175 |
// Nothing should be received because both the stdout and stderr of the container will be |
| 176 | 176 |
// sent to the client as stdout when tty is enabled. |
| ... | ... |
@@ -1442,7 +1442,7 @@ func (s *DockerSuite) TestPutContainerArchiveErrSymlinkInVolumeToReadOnlyRootfs( |
| 1442 | 1442 |
// directory outside the volume. This should cause an error because the |
| 1443 | 1443 |
// rootfs is read-only. |
| 1444 | 1444 |
var httpClient *http.Client |
| 1445 |
- cli, err := client.NewClient(daemonHost(), "v1.20", httpClient, map[string]string{})
|
|
| 1445 |
+ cli, err := client.NewClient(request.DaemonHost(), "v1.20", httpClient, map[string]string{})
|
|
| 1446 | 1446 |
c.Assert(err, checker.IsNil) |
| 1447 | 1447 |
|
| 1448 | 1448 |
err = cli.CopyToContainer(context.Background(), cID, "/vol2/symlinkToAbsDir", nil, types.CopyToContainerOptions{})
|
| ... | ... |
@@ -64,7 +64,7 @@ func (s *DockerSuite) TestExecResizeImmediatelyAfterExecStart(c *check.C) {
|
| 64 | 64 |
} |
| 65 | 65 |
|
| 66 | 66 |
payload := bytes.NewBufferString(`{"Tty":true}`)
|
| 67 |
- conn, _, err := sockRequestHijack("POST", fmt.Sprintf("/exec/%s/start", execID), payload, "application/json", daemonHost())
|
|
| 67 |
+ conn, _, err := sockRequestHijack("POST", fmt.Sprintf("/exec/%s/start", execID), payload, "application/json", request.DaemonHost())
|
|
| 68 | 68 |
if err != nil {
|
| 69 | 69 |
return fmt.Errorf("Failed to start the exec: %q", err.Error())
|
| 70 | 70 |
} |
| ... | ... |
@@ -19,16 +19,10 @@ import ( |
| 19 | 19 |
"github.com/docker/docker/integration-cli/checker" |
| 20 | 20 |
"github.com/docker/docker/integration-cli/cli" |
| 21 | 21 |
"github.com/docker/docker/integration-cli/daemon" |
| 22 |
- "github.com/docker/docker/internal/test/request" |
|
| 23 | 22 |
"github.com/go-check/check" |
| 24 | 23 |
"gotest.tools/icmd" |
| 25 | 24 |
) |
| 26 | 25 |
|
| 27 |
-// Deprecated |
|
| 28 |
-func daemonHost() string {
|
|
| 29 |
- return request.DaemonHost() |
|
| 30 |
-} |
|
| 31 |
- |
|
| 32 | 26 |
func deleteImages(images ...string) error {
|
| 33 | 27 |
args := []string{dockerBinary, "rmi", "-f"}
|
| 34 | 28 |
return icmd.RunCmd(icmd.Cmd{Command: append(args, images...)}).Error
|