Skip to content

Commit 2faeda2

Browse files
authored
[FIX] tools: use api version negotation when creating the docker client (#679)
1 parent 9abcbed commit 2faeda2

File tree

335 files changed

+26037
-17453
lines changed

Some content is hidden

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

335 files changed

+26037
-17453
lines changed

tools/cmd/image.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import (
1515
func imageSave(images []string, dest, clusterName string) error {
1616
// get a docker client
1717
ctx := context.Background()
18-
docker, err := client.NewEnvClient()
18+
docker, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
1919
if err != nil {
20-
return fmt.Errorf("ERROR: couldn't create docker client\n%+v", err)
20+
return fmt.Errorf("ERROR: couldn't create docker client\n%w", err)
2121
}
2222

2323
imageReader, err := docker.ImageSave(ctx, images)
2424
if err != nil {
25-
return fmt.Errorf("ERROR: couldn't save images %s\n%+v", images, err)
25+
return fmt.Errorf("ERROR: couldn't save images %s\n%w", images, err)
2626
}
2727
defer imageReader.Close()
2828

@@ -35,12 +35,12 @@ func imageSave(images []string, dest, clusterName string) error {
3535
}
3636
tarFile, err := os.Create(tarFileName)
3737
if err != nil {
38-
return fmt.Errorf("ERROR: couldn't create tarfile [%s]\n%+v", tarFileName, err)
38+
return fmt.Errorf("ERROR: couldn't create tarfile [%s]\n%w", tarFileName, err)
3939
}
4040
defer tarFile.Close()
4141

4242
if _, err = io.Copy(tarFile, imageReader); err != nil {
43-
return fmt.Errorf("ERROR: couldn't save image stream to tarfile\n%+v", err)
43+
return fmt.Errorf("ERROR: couldn't save image stream to tarfile\n%w", err)
4444
}
4545

4646
log.Printf("INFO: saved images %s to [%s]", images, tarFileName)

tools/go.mod

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ require (
66
github.com/Microsoft/go-winio v0.4.12 // indirect
77
github.com/containerd/containerd v1.4.3 // indirect
88
github.com/docker/distribution v2.7.1+incompatible // indirect
9-
github.com/docker/docker v20.10.5+incompatible
9+
github.com/docker/docker v20.10.8+incompatible
1010
github.com/docker/go-connections v0.4.0 // indirect
1111
github.com/docker/go-units v0.4.0 // indirect
1212
github.com/gogo/protobuf v1.3.2 // indirect
1313
github.com/gorilla/mux v1.8.0 // indirect
1414
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
1515
github.com/morikuni/aec v1.0.0 // indirect
16-
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
16+
github.com/opencontainers/go-digest v1.0.0 // indirect
1717
github.com/opencontainers/image-spec v1.0.1 // indirect
18-
github.com/sirupsen/logrus v1.8.0 // indirect
18+
github.com/sirupsen/logrus v1.8.1 // indirect
1919
github.com/urfave/cli v1.20.0
20+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
2021
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
2122
google.golang.org/grpc v1.36.0 // indirect
2223
gotest.tools/v3 v3.0.3 // indirect

tools/go.sum

+8-9
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1515
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1616
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
1717
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
18-
github.com/docker/docker v20.10.5+incompatible h1:o5WL5onN4awYGwrW7+oTn5x9AF2prw7V0Ox8ZEkoCdg=
19-
github.com/docker/docker v20.10.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
18+
github.com/docker/docker v20.10.8+incompatible h1:RVqD337BgQicVCzYrrlhLDWhq6OAD2PJDUg2LsEUvKM=
19+
github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
2020
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
2121
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
2222
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
@@ -50,14 +50,12 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
5050
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
5151
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
5252
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
53-
github.com/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g=
54-
github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
5553
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 h1:rzf0wL0CHVc8CEsgyygG0Mn9CNCCPZqOPaz8RiiHYQk=
5654
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
5755
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
5856
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
59-
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
60-
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
57+
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
58+
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
6159
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
6260
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
6361
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -66,8 +64,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
6664
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6765
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6866
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
69-
github.com/sirupsen/logrus v1.8.0 h1:nfhvjKcUMhBMVqbKHJlk5RPrrfYr/NMo3692g0dwfWU=
70-
github.com/sirupsen/logrus v1.8.0/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A=
67+
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
68+
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
7169
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
7270
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7371
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
@@ -106,8 +104,9 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
106104
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
107105
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
108106
golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
109-
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
110107
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
108+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
109+
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
111110
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
112111
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
113112
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

tools/vendor/github.com/docker/docker/api/swagger.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/vendor/github.com/docker/docker/client/client.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/vendor/github.com/magefile/mage/mg/color.go

-80
This file was deleted.

tools/vendor/github.com/magefile/mage/mg/color_string.go

-38
This file was deleted.

0 commit comments

Comments
 (0)