Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 0ad950c

Browse files
author
Vincent Demeester
authored
Merge pull request #479 from vdemeester/update-deps
Update deps
2 parents 9e64d2c + 9b7aa6f commit 0ad950c

File tree

212 files changed

+10473
-2054
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+10473
-2054
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file describes the standard way to build libcompose, using docker
2-
FROM golang:1.7.5
2+
FROM golang:1.8.3
33

44
# virtualenv is necessary to run acceptance tests
55
RUN apt-get update && \
@@ -13,18 +13,23 @@ RUN go get github.com/aktau/github-release && \
1313
go get github.com/golang/lint/golint
1414

1515
# Which docker version to test on and what default one to use
16-
ENV DOCKER_VERSIONS 1.9.1 1.10.3 1.11.2 1.12.6 1.13.0
17-
ENV DEFAULT_DOCKER_VERSION 1.10.3
16+
ENV DOCKER_VERSIONS 1.9.1 1.10.3 1.13.1 17.03.2 17.06.0
17+
ENV DEFAULT_DOCKER_VERSION 17.03.2
1818

1919
# Download docker
20-
RUN set -e; \
20+
RUN set -e; set -x; \
2121
for v in $(echo ${DOCKER_VERSIONS} | cut -f1); do \
2222
if test "${v}" = "1.9.1" || test "${v}" = "1.10.3"; then \
2323
mkdir -p /usr/local/bin/docker-${v}/; \
2424
curl https://get.docker.com/builds/Linux/x86_64/docker-${v} -o /usr/local/bin/docker-${v}/docker; \
2525
chmod +x /usr/local/bin/docker-${v}/docker; \
26+
elif test "${v}" = "1.13.1"; then \
27+
curl https://get.docker.com/builds/Linux/x86_64/docker-${v}.tgz -o docker-${v}.tgz; \
28+
tar xzf docker-${v}.tgz -C /usr/local/bin/; \
29+
mv /usr/local/bin/docker /usr/local/bin/docker-${v}; \
30+
rm docker-${v}.tgz; \
2631
else \
27-
curl https://get.docker.com/builds/Linux/x86_64/docker-${v}.tgz -o docker-${v}.tgz; \
32+
curl https://download.docker.com/linux/static/stable/x86_64/docker-${v}-ce.tgz -o docker-${v}.tgz; \
2833
tar xzf docker-${v}.tgz -C /usr/local/bin/; \
2934
mv /usr/local/bin/docker /usr/local/bin/docker-${v}; \
3035
rm docker-${v}.tgz; \

docker/auth/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package auth
22

33
import (
4+
"github.com/docker/cli/cli/config/configfile"
45
"github.com/docker/docker/api/types"
5-
"github.com/docker/docker/cli/config/configfile"
66
"github.com/docker/docker/registry"
77
)
88

docker/builder/builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"strings"
1010

1111
"github.com/Sirupsen/logrus"
12+
"github.com/docker/cli/cli/command/image/build"
1213
"github.com/docker/docker/api/types"
1314
"github.com/docker/docker/builder/dockerignore"
14-
"github.com/docker/docker/cli/command/image/build"
1515
"github.com/docker/docker/client"
1616
"github.com/docker/docker/pkg/archive"
1717
"github.com/docker/docker/pkg/fileutils"
@@ -75,7 +75,7 @@ func (d *DaemonBuilder) Build(ctx context.Context, imageName string) error {
7575
}
7676

7777
// Setup an upload progress bar
78-
progressOutput := streamformatter.NewStreamFormatter().NewProgressOutput(progBuff, true)
78+
progressOutput := streamformatter.NewProgressOutput(progBuff)
7979

8080
var body io.Reader = progress.NewProgressReader(buildCtx, progressOutput, 0, "", "Sending build context to Docker daemon")
8181

docker/builder/builder_test.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ import (
1313
"golang.org/x/net/context"
1414

1515
"github.com/docker/docker/api/types"
16+
"github.com/docker/docker/client"
1617
"github.com/docker/docker/pkg/archive"
1718
"github.com/docker/docker/pkg/jsonmessage"
18-
"github.com/docker/libcompose/test"
19+
"github.com/pkg/errors"
20+
"strings"
1921
)
2022

21-
type DaemonClient struct {
22-
test.NopClient
23+
type daemonClient struct {
24+
client.Client
2325
contextDir string
2426
imageName string
2527
changes int
2628
message jsonmessage.JSONMessage
2729
}
2830

29-
func (c *DaemonClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
31+
func (c *daemonClient) ImageBuild(ctx context.Context, context io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error) {
3032
if c.imageName != "" {
3133
if len(options.Tags) != 1 || options.Tags[0] != c.imageName {
3234
return types.ImageBuildResponse{}, fmt.Errorf("expected image %q, got %v", c.imageName, options.Tags)
@@ -55,7 +57,9 @@ func (c *DaemonClient) ImageBuild(ctx context.Context, context io.Reader, option
5557
Body: ioutil.NopCloser(bytes.NewReader(b)),
5658
}, nil
5759
}
58-
return c.NopClient.ImageBuild(ctx, context, options)
60+
return types.ImageBuildResponse{
61+
Body: ioutil.NopCloser(strings.NewReader("{}")),
62+
}, errors.New("Engine no longer exists")
5963
}
6064

6165
func TestBuildInvalidContextDirectoryOrDockerfile(t *testing.T) {
@@ -118,7 +122,7 @@ func TestBuildWithClientBuildError(t *testing.T) {
118122
}
119123

120124
imageName := "image"
121-
client := &DaemonClient{}
125+
client := &daemonClient{}
122126
builder := &DaemonBuilder{
123127
ContextDirectory: tmpDir,
124128
Client: client,
@@ -144,7 +148,7 @@ func TestBuildWithDefaultDockerfile(t *testing.T) {
144148
}
145149

146150
imageName := "image"
147-
client := &DaemonClient{
151+
client := &daemonClient{
148152
contextDir: tmpDir,
149153
imageName: imageName,
150154
}
@@ -173,7 +177,7 @@ func TestBuildWithDefaultLowercaseDockerfile(t *testing.T) {
173177
}
174178

175179
imageName := "image"
176-
client := &DaemonClient{
180+
client := &daemonClient{
177181
contextDir: tmpDir,
178182
imageName: imageName,
179183
}
@@ -202,7 +206,7 @@ func TestBuildWithSpecificDockerfile(t *testing.T) {
202206
}
203207

204208
imageName := "image"
205-
client := &DaemonClient{
209+
client := &daemonClient{
206210
contextDir: tmpDir,
207211
imageName: imageName,
208212
}
@@ -235,7 +239,7 @@ func TestBuildWithDockerignoreNothing(t *testing.T) {
235239
}
236240

237241
imageName := "image"
238-
client := &DaemonClient{
242+
client := &daemonClient{
239243
contextDir: tmpDir,
240244
imageName: imageName,
241245
}
@@ -268,7 +272,7 @@ func TestBuildWithDockerignoreDockerfileAndItself(t *testing.T) {
268272
}
269273

270274
imageName := "image"
271-
client := &DaemonClient{
275+
client := &daemonClient{
272276
contextDir: tmpDir,
273277
imageName: imageName,
274278
}
@@ -301,7 +305,7 @@ func TestBuildWithDockerignoreAfile(t *testing.T) {
301305
}
302306

303307
imageName := "image"
304-
client := &DaemonClient{
308+
client := &daemonClient{
305309
contextDir: tmpDir,
306310
imageName: imageName,
307311
changes: 1,
@@ -332,7 +336,7 @@ func TestBuildWithErrorJSONMessage(t *testing.T) {
332336
}
333337

334338
imageName := "image"
335-
client := &DaemonClient{
339+
client := &daemonClient{
336340
contextDir: tmpDir,
337341
imageName: imageName,
338342
message: jsonmessage.JSONMessage{

docker/client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"path/filepath"
88
"runtime"
99

10-
cliconfig "github.com/docker/docker/cli/config"
10+
cliconfig "github.com/docker/cli/cli/config"
1111
"github.com/docker/docker/client"
1212
"github.com/docker/docker/pkg/homedir"
1313
"github.com/docker/go-connections/sockets"

docker/client/client_factory_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package client
22

33
import (
4+
"strings"
45
"testing"
56
)
67

@@ -18,7 +19,7 @@ func TestFactoryWithEnv(t *testing.T) {
1819
envs: map[string]string{
1920
"DOCKER_CERT_PATH": "invalid/path",
2021
},
21-
expectedError: "Could not load X509 key pair: open invalid/path/cert.pem: no such file or directory. Make sure the key is not encrypted",
22+
expectedError: "Could not load X509 key pair: open invalid/path/cert.pem: no such file or directory",
2223
expectedVersion: "v1.20",
2324
},
2425
{
@@ -32,7 +33,7 @@ func TestFactoryWithEnv(t *testing.T) {
3233
recoverEnvs := setupEnvs(t, c.envs)
3334
factory, err := NewDefaultFactory(Options{})
3435
if c.expectedError != "" {
35-
if err == nil || err.Error() != c.expectedError {
36+
if err == nil || !strings.Contains(err.Error(), c.expectedError) {
3637
t.Errorf("expected an error %s, got %s, for %v", c.expectedError, err.Error(), c)
3738
}
3839
} else {
@@ -59,7 +60,7 @@ func TestFactoryWithOptions(t *testing.T) {
5960
options: Options{
6061
Host: "host",
6162
},
62-
expectedError: "unable to parse docker host `host`",
63+
expectedError: "unable to parse docker host",
6364
},
6465
{
6566
options: Options{
@@ -78,7 +79,7 @@ func TestFactoryWithOptions(t *testing.T) {
7879
for _, c := range cases {
7980
factory, err := NewDefaultFactory(c.options)
8081
if c.expectedError != "" {
81-
if err == nil || err.Error() != c.expectedError {
82+
if err == nil || !strings.Contains(err.Error(), c.expectedError) {
8283
t.Errorf("expected an error %s, got %s, for %v", c.expectedError, err.Error(), c)
8384
}
8485
} else {

docker/client/client_test.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ package client
33
import (
44
"fmt"
55
"os"
6+
"strings"
67
"testing"
78

8-
cliconfig "github.com/docker/docker/cli/config"
9+
cliconfig "github.com/docker/cli/cli/config"
910
"github.com/docker/go-connections/tlsconfig"
1011
)
1112

@@ -24,13 +25,13 @@ func TestCreateWithEnv(t *testing.T) {
2425
envs: map[string]string{
2526
"DOCKER_CERT_PATH": "invalid/path",
2627
},
27-
expectedError: "Could not load X509 key pair: open invalid/path/cert.pem: no such file or directory. Make sure the key is not encrypted",
28+
expectedError: "Could not load X509 key pair: open invalid/path/cert.pem: no such file or directory",
2829
},
2930
{
3031
envs: map[string]string{
3132
"DOCKER_HOST": "host",
3233
},
33-
expectedError: "unable to parse docker host `host`",
34+
expectedError: "unable to parse docker host",
3435
},
3536
{
3637
envs: map[string]string{
@@ -55,8 +56,8 @@ func TestCreateWithEnv(t *testing.T) {
5556
recoverEnvs := setupEnvs(t, c.envs)
5657
apiclient, err := Create(Options{})
5758
if c.expectedError != "" {
58-
if err == nil || err.Error() != c.expectedError {
59-
t.Errorf("expected an error %s, got %s, for %v", c.expectedError, err.Error(), c)
59+
if err == nil || !strings.Contains(err.Error(), c.expectedError) {
60+
t.Errorf("expected an error '%s', got '%s', for %v", c.expectedError, err.Error(), c)
6061
}
6162
} else {
6263
if err != nil {
@@ -81,7 +82,7 @@ func TestCreateWithOptions(t *testing.T) {
8182
options: Options{
8283
Host: "host",
8384
},
84-
expectedError: "unable to parse docker host `host`",
85+
expectedError: "unable to parse docker host",
8586
},
8687
{
8788
options: Options{
@@ -109,7 +110,7 @@ func TestCreateWithOptions(t *testing.T) {
109110
TLS: true,
110111
APIVersion: "v1.22",
111112
},
112-
expectedError: fmt.Sprintf("Could not load X509 key pair: open %s/cert.pem: no such file or directory. Make sure the key is not encrypted", cliconfig.Dir()),
113+
expectedError: fmt.Sprintf("Could not load X509 key pair: open %s/cert.pem: no such file or directory", cliconfig.Dir()),
113114
},
114115
{
115116
options: Options{
@@ -123,7 +124,7 @@ func TestCreateWithOptions(t *testing.T) {
123124
TrustKey: "invalid/trust/key",
124125
APIVersion: "v1.22",
125126
},
126-
expectedError: "Could not load X509 key pair: open invalid/cert/file: no such file or directory. Make sure the key is not encrypted",
127+
expectedError: "Could not load X509 key pair: open invalid/cert/file: no such file or directory",
127128
},
128129
{
129130
options: Options{
@@ -136,7 +137,7 @@ func TestCreateWithOptions(t *testing.T) {
136137
},
137138
APIVersion: "v1.22",
138139
},
139-
expectedError: "unable to parse docker host `host`",
140+
expectedError: "unable to parse docker host",
140141
},
141142
{
142143
options: Options{
@@ -155,8 +156,8 @@ func TestCreateWithOptions(t *testing.T) {
155156
for _, c := range cases {
156157
apiclient, err := Create(c.options)
157158
if c.expectedError != "" {
158-
if err == nil || err.Error() != c.expectedError {
159-
t.Errorf("expected an error %s, got %s, for %v", c.expectedError, err.Error(), c)
159+
if err == nil || !strings.Contains(err.Error(), c.expectedError) {
160+
t.Errorf("expected an error '%s', got '%s', for %v", c.expectedError, err.Error(), c)
160161
}
161162
} else {
162163
if err != nil {

docker/ctx/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package ctx
22

33
import (
4-
cliconfig "github.com/docker/docker/cli/config"
5-
"github.com/docker/docker/cli/config/configfile"
4+
cliconfig "github.com/docker/cli/cli/config"
5+
"github.com/docker/cli/cli/config/configfile"
66
"github.com/docker/libcompose/docker/auth"
77
"github.com/docker/libcompose/docker/client"
88
"github.com/docker/libcompose/project"

docker/network/network.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (n *Network) fullName() string {
3535

3636
// Inspect inspect the current network
3737
func (n *Network) Inspect(ctx context.Context) (types.NetworkResource, error) {
38-
return n.client.NetworkInspect(ctx, n.fullName())
38+
return n.client.NetworkInspect(ctx, n.fullName(), false)
3939
}
4040

4141
// Remove removes the current network (from docker engine)

docker/network/network_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import (
88

99
"github.com/docker/docker/api/types"
1010
"github.com/docker/docker/api/types/network"
11+
"github.com/docker/docker/client"
1112
"github.com/docker/libcompose/config"
12-
"github.com/docker/libcompose/test"
1313
"github.com/docker/libcompose/yaml"
14+
"github.com/pkg/errors"
1415
)
1516

1617
type networkNotFound struct {
@@ -218,7 +219,7 @@ func testExpectedContainsNetwork(t *testing.T, index int, expected []*Network, n
218219
}
219220

220221
type networkClient struct {
221-
test.NopClient
222+
client.Client
222223
expectedNetworkCreate types.NetworkCreate
223224
expectedRemoveNetworkID string
224225
expectedName string
@@ -228,7 +229,7 @@ type networkClient struct {
228229
removeError error
229230
}
230231

231-
func (c *networkClient) NetworkInspect(ctx context.Context, networkID string) (types.NetworkResource, error) {
232+
func (c *networkClient) NetworkInspect(ctx context.Context, networkID string, verbose bool) (types.NetworkResource, error) {
232233
if c.inspectError != nil {
233234
return types.NetworkResource{}, c.inspectError
234235
}
@@ -254,7 +255,7 @@ func (c *networkClient) NetworkCreate(ctx context.Context, name string, options
254255
ID: c.expectedName,
255256
}, nil
256257
}
257-
return c.NopClient.NetworkCreate(ctx, name, options)
258+
return types.NetworkCreateResponse{}, errors.New("Engine no longer exists")
258259
}
259260

260261
func (c *networkClient) NetworkRemove(ctx context.Context, networkID string) error {
@@ -264,7 +265,7 @@ func (c *networkClient) NetworkRemove(ctx context.Context, networkID string) err
264265
}
265266
return nil
266267
}
267-
return c.NopClient.NetworkRemove(ctx, networkID)
268+
return errors.New("Engine no longer exists")
268269
}
269270

270271
func TestNetworksInitialize(t *testing.T) {

0 commit comments

Comments
 (0)