summaryrefslogtreecommitdiff
path: root/integration-cli/docker_api_build_test.go
diff options
context:
space:
mode:
authorDaniel Nephin <dnephin@docker.com>2017-09-19 16:12:29 -0400
committerDaniel Nephin <dnephin@docker.com>2018-02-20 17:27:24 -0500
commit0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4 (patch)
tree59032a04296094e80682b71c3d3866b13456785d /integration-cli/docker_api_build_test.go
parenta68ae4a2d95b1ff143025a435195af0f1ab30ace (diff)
downloaddocker-0a91ba2d8cfe16df0ba37c1e283c8e3dbbb086d4.tar.gz
Remove duplicate calls for getting an APIClient
Remove request.SockRequest Remove request.SockRequestHijack Remove request.SockRequestRaw() Remove deprecated ParseHost Deprecate and unexport more helpers Signed-off-by: Daniel Nephin <dnephin@docker.com>
Diffstat (limited to 'integration-cli/docker_api_build_test.go')
-rw-r--r--integration-cli/docker_api_build_test.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go
index 6da8e5bb8f..e5423a4741 100644
--- a/integration-cli/docker_api_build_test.go
+++ b/integration-cli/docker_api_build_test.go
@@ -319,8 +319,7 @@ func (s *DockerSuite) TestBuildOnBuildCache(c *check.C) {
assert.Len(c, imageIDs, 2)
parentID, childID := imageIDs[0], imageIDs[1]
- client, err := request.NewClient()
- require.NoError(c, err)
+ client := testEnv.APIClient()
// check parentID is correct
image, _, err := client.ImageInspectWithRaw(context.Background(), childID)
@@ -329,12 +328,11 @@ func (s *DockerSuite) TestBuildOnBuildCache(c *check.C) {
}
func (s *DockerRegistrySuite) TestBuildCopyFromForcePull(c *check.C) {
- client, err := request.NewClient()
- require.NoError(c, err)
+ client := testEnv.APIClient()
repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL)
// tag the image to upload it to the private registry
- err = client.ImageTag(context.TODO(), "busybox", repoName)
+ err := client.ImageTag(context.TODO(), "busybox", repoName)
assert.Nil(c, err)
// push the image to the registry
rc, err := client.ImagePush(context.TODO(), repoName, types.ImagePushOptions{RegistryAuth: "{}"})
@@ -545,9 +543,7 @@ func (s *DockerSuite) TestBuildWithSession(c *check.C) {
assert.Equal(c, strings.Count(out, "Using cache"), 2)
assert.Contains(c, out, "contentcontent")
- client, err := request.NewClient()
- require.NoError(c, err)
-
+ client := testEnv.APIClient()
du, err := client.DiskUsage(context.TODO())
assert.Nil(c, err)
assert.True(c, du.BuilderSize > 10)
@@ -582,9 +578,7 @@ func (s *DockerSuite) TestBuildWithSession(c *check.C) {
}
func testBuildWithSession(c *check.C, dir, dockerfile string) (outStr string) {
- client, err := request.NewClient()
- require.NoError(c, err)
-
+ client := testEnv.APIClient()
sess, err := session.NewSession("foo1", "foo")
assert.Nil(c, err)