Skip to content

Commit 58bc354

Browse files
IcefeastLadislav Zvadashueybubbles
authored
bump to docker v27.3.1+incompatible (#554)
Co-authored-by: Ladislav Zvada <ladislav.zvada@swissre.com> Co-authored-by: David Shiflet <david.shiflet@microsoft.com>
1 parent 708776a commit 58bc354

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/alecthomas/chroma/v2 v2.5.0
77
github.com/billgraziano/dpapi v0.4.0
88
github.com/docker/distribution v2.8.2+incompatible
9-
github.com/docker/docker v25.0.6+incompatible
9+
github.com/docker/docker v27.3.1+incompatible
1010
github.com/docker/go-connections v0.4.0
1111
github.com/golang-sql/sqlexp v0.1.0
1212
github.com/google/uuid v1.6.0
@@ -57,6 +57,7 @@ require (
5757
github.com/mattn/go-runewidth v0.0.3 // indirect
5858
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
5959
github.com/mitchellh/mapstructure v1.5.0 // indirect
60+
github.com/moby/docker-image-spec v1.3.1 // indirect
6061
github.com/moby/term v0.0.0-20221120202655-abb19827d345 // indirect
6162
github.com/morikuni/aec v1.0.0 // indirect
6263
github.com/opencontainers/go-digest v1.0.0 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3
9797
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
9898
github.com/docker/docker v25.0.6+incompatible h1:5cPwbwriIcsua2REJe8HqQV+6WlWc1byg2QSXzBxBGg=
9999
github.com/docker/docker v25.0.6+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
100+
github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI=
101+
github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
100102
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
101103
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
102104
github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8=
@@ -255,6 +257,8 @@ github.com/microsoft/go-mssqldb v1.8.0 h1:7cyZ/AT7ycDsEoWPIXibd+aVKFtteUNhDGf3ao
255257
github.com/microsoft/go-mssqldb v1.8.0/go.mod h1:6znkekS3T2vp0waiMhen4GPU1BiAsrP+iXHcE7a7rFo=
256258
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
257259
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
260+
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
261+
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
258262
github.com/moby/term v0.0.0-20221120202655-abb19827d345 h1:J9c53/kxIH+2nTKBEfZYFMlhghtHpIHSXpm5VRGHSnU=
259263
github.com/moby/term v0.0.0-20221120202655-abb19827d345/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM=
260264
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=

internal/container/controller.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/docker/docker/api/types"
1616
"github.com/docker/docker/api/types/container"
1717
"github.com/docker/docker/api/types/filters"
18+
"github.com/docker/docker/api/types/image"
1819
"github.com/docker/docker/client"
1920
"github.com/docker/docker/pkg/stdcopy"
2021
"github.com/docker/go-connections/nat"
@@ -33,7 +34,10 @@ type Controller struct {
3334
func NewController() (c *Controller) {
3435
var err error
3536
c = new(Controller)
36-
c.cli, err = client.NewClientWithOpts(client.FromEnv)
37+
c.cli, err = client.NewClientWithOpts(
38+
client.FromEnv,
39+
client.WithVersion("1.45"),
40+
)
3741
checkErr(err)
3842

3943
return
@@ -45,11 +49,11 @@ func NewController() (c *Controller) {
4549
// if one occurred while creating the client. The Controller struct has a
4650
// method EnsureImage() which pulls an image with the given name from
4751
// a registry and logs the output to the console.
48-
func (c Controller) EnsureImage(image string) (err error) {
52+
func (c Controller) EnsureImage(imageName string) (err error) {
4953
var reader io.ReadCloser
5054

51-
trace("Running ImagePull for image %s", image)
52-
reader, err = c.cli.ImagePull(context.Background(), image, types.ImagePullOptions{})
55+
trace("Running ImagePull for image %s", imageName)
56+
reader, err = c.cli.ImagePull(context.Background(), imageName, image.PullOptions{})
5357
if reader != nil {
5458
defer func() {
5559
checkErr(reader.Close())
@@ -106,7 +110,7 @@ func (c Controller) ContainerRun(
106110
err = c.cli.ContainerStart(
107111
context.Background(),
108112
resp.ID,
109-
types.ContainerStartOptions{},
113+
container.StartOptions{},
110114
)
111115
if err != nil || unitTestFailure {
112116
// Remove the container, because we haven't persisted to config yet, so
@@ -131,7 +135,7 @@ func (c Controller) ContainerRun(
131135
// This function is useful for waiting until a specific event has occurred in the
132136
// container (e.g. a server has started up) before continuing with other operations.
133137
func (c Controller) ContainerWaitForLogEntry(id string, text string) {
134-
options := types.ContainerLogsOptions{
138+
options := container.LogsOptions{
135139
ShowStdout: true,
136140
ShowStderr: false,
137141
Since: "",
@@ -177,7 +181,7 @@ func (c Controller) ContainerStart(id string) (err error) {
177181
panic("Must pass in non-empty id")
178182
}
179183

180-
err = c.cli.ContainerStart(context.Background(), id, types.ContainerStartOptions{})
184+
err = c.cli.ContainerStart(context.Background(), id, container.StartOptions{})
181185
return
182186
}
183187

@@ -329,7 +333,7 @@ func (c Controller) ContainerExists(id string) (exists bool) {
329333
)
330334
resp, err := c.cli.ContainerList(
331335
context.Background(),
332-
types.ContainerListOptions{Filters: f},
336+
container.ListOptions{Filters: f},
333337
)
334338
checkErr(err)
335339
if len(resp) > 0 {
@@ -352,7 +356,7 @@ func (c Controller) ContainerRemove(id string) (err error) {
352356
panic("Must pass in non-empty id")
353357
}
354358

355-
options := types.ContainerRemoveOptions{
359+
options := container.RemoveOptions{
356360
RemoveVolumes: false,
357361
RemoveLinks: false,
358362
Force: false,

0 commit comments

Comments
 (0)