Skip to content

Commit f94ff35

Browse files
Merge pull request #1146 from matejvasek/update-docker-v26
chore: update docker to v26
2 parents bf52fc0 + e24d63b commit f94ff35

Some content is hidden

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

46 files changed

+462
-329
lines changed

go.mod

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ go 1.20
44

55
require (
66
github.com/containers/image/v5 v5.29.0
7-
github.com/docker/distribution v2.8.3+incompatible
8-
github.com/docker/docker v25.0.3+incompatible
7+
github.com/distribution/reference v0.5.0
8+
github.com/docker/docker v26.1.3+incompatible
99
github.com/docker/go-connections v0.4.0
1010
github.com/go-imports-organizer/goio v1.3.3
1111
github.com/moby/buildkit v0.12.4
@@ -30,7 +30,7 @@ require (
3030
github.com/containers/ocicrypt v1.1.9 // indirect
3131
github.com/containers/storage v1.51.0 // indirect
3232
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
33-
github.com/distribution/reference v0.5.0 // indirect
33+
github.com/docker/distribution v2.8.3+incompatible // indirect
3434
github.com/docker/docker-credential-helpers v0.8.0 // indirect
3535
github.com/docker/go-units v0.5.0 // indirect
3636
github.com/felixge/httpsnoop v1.0.3 // indirect
@@ -52,6 +52,7 @@ require (
5252
github.com/kr/text v0.2.0 // indirect
5353
github.com/mattn/go-shellwords v1.0.12 // indirect
5454
github.com/mistifyio/go-zfs/v3 v3.0.1 // indirect
55+
github.com/moby/docker-image-spec v1.3.1 // indirect
5556
github.com/moby/sys/mountinfo v0.7.1 // indirect
5657
github.com/moby/term v0.5.0 // indirect
5758
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5
4747
github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg=
4848
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
4949
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
50-
github.com/docker/docker v25.0.3+incompatible h1:D5fy/lYmY7bvZa0XTZ5/UJPljor41F+vdyJG5luQLfQ=
51-
github.com/docker/docker v25.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
50+
github.com/docker/docker v26.1.3+incompatible h1:lLCzRbrVZrljpVNobJu1J2FHk8V0s4BawoZippkc+xo=
51+
github.com/docker/docker v26.1.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
5252
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
5353
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
5454
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
@@ -133,6 +133,8 @@ github.com/mistifyio/go-zfs/v3 v3.0.1 h1:YaoXgBePoMA12+S1u/ddkv+QqxcfiZK4prI6HPn
133133
github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k=
134134
github.com/moby/buildkit v0.12.4 h1:yKZDsObXLKarXqUx7YMnaB+TKv810bBhq0XLFWbkjT0=
135135
github.com/moby/buildkit v0.12.4/go.mod h1:XG74uz06nPWQpnxYwgCryrVidvor0+ElUxGosbZPQG4=
136+
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
137+
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
136138
github.com/moby/sys/mountinfo v0.7.1 h1:/tTvQaSJRr2FshkhXiIpux6fQ2Zvc4j7tAhMTStAG2g=
137139
github.com/moby/sys/mountinfo v0.7.1/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
138140
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=

pkg/api/validation/validation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/docker/distribution/reference"
7+
"github.com/distribution/reference"
88

99
"github.com/openshift/source-to-image/pkg/api"
1010
)

pkg/docker/docker.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

2222
dockertypes "github.com/docker/docker/api/types"
2323
dockercontainer "github.com/docker/docker/api/types/container"
24+
"github.com/docker/docker/api/types/image"
2425
dockernetwork "github.com/docker/docker/api/types/network"
2526
"github.com/docker/docker/api/types/registry"
2627
dockerapi "github.com/docker/docker/client"
@@ -122,20 +123,20 @@ type Docker interface {
122123

123124
// Client contains all methods used when interacting directly with docker engine-api
124125
type Client interface {
125-
ContainerAttach(ctx context.Context, container string, options dockertypes.ContainerAttachOptions) (dockertypes.HijackedResponse, error)
126-
ContainerCommit(ctx context.Context, container string, options dockertypes.ContainerCommitOptions) (dockertypes.IDResponse, error)
126+
ContainerAttach(ctx context.Context, container string, options dockercontainer.AttachOptions) (dockertypes.HijackedResponse, error)
127+
ContainerCommit(ctx context.Context, container string, options dockercontainer.CommitOptions) (dockertypes.IDResponse, error)
127128
ContainerCreate(ctx context.Context, config *dockercontainer.Config, hostConfig *dockercontainer.HostConfig, networkingConfig *dockernetwork.NetworkingConfig, platform *v1.Platform, containerName string) (dockercontainer.CreateResponse, error)
128129
ContainerInspect(ctx context.Context, container string) (dockertypes.ContainerJSON, error)
129-
ContainerRemove(ctx context.Context, container string, options dockertypes.ContainerRemoveOptions) error
130-
ContainerStart(ctx context.Context, container string, options dockertypes.ContainerStartOptions) error
130+
ContainerRemove(ctx context.Context, container string, options dockercontainer.RemoveOptions) error
131+
ContainerStart(ctx context.Context, container string, options dockercontainer.StartOptions) error
131132
ContainerKill(ctx context.Context, container, signal string) error
132133
ContainerWait(ctx context.Context, container string, condition dockercontainer.WaitCondition) (<-chan dockercontainer.WaitResponse, <-chan error)
133134
CopyToContainer(ctx context.Context, container, path string, content io.Reader, opts dockertypes.CopyToContainerOptions) error
134135
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, dockertypes.ContainerPathStat, error)
135136
ImageBuild(ctx context.Context, buildContext io.Reader, options dockertypes.ImageBuildOptions) (dockertypes.ImageBuildResponse, error)
136137
ImageInspectWithRaw(ctx context.Context, image string) (dockertypes.ImageInspect, []byte, error)
137138
ImagePull(ctx context.Context, ref string, options dockertypes.ImagePullOptions) (io.ReadCloser, error)
138-
ImageRemove(ctx context.Context, image string, options dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error)
139+
ImageRemove(ctx context.Context, image string, options dockertypes.ImageRemoveOptions) ([]image.DeleteResponse, error)
139140
ServerVersion(ctx context.Context) (dockertypes.Version, error)
140141
}
141142

@@ -260,8 +261,8 @@ func (rco RunContainerOptions) asDockerCreateContainerOptions() configWrapper {
260261

261262
// asDockerAttachToContainerOptions converts a RunContainerOptions into a
262263
// ContainerAttachOptions understood by the docker client
263-
func (rco RunContainerOptions) asDockerAttachToContainerOptions() dockertypes.ContainerAttachOptions {
264-
return dockertypes.ContainerAttachOptions{
264+
func (rco RunContainerOptions) asDockerAttachToContainerOptions() dockercontainer.AttachOptions {
265+
return dockercontainer.AttachOptions{
265266
Stdin: rco.Stdin != nil,
266267
Stdout: rco.Stdout != nil,
267268
Stderr: rco.Stderr != nil,
@@ -631,7 +632,7 @@ func updateImageWithInspect(image *api.Image, inspect *dockertypes.ImageInspect)
631632
func (d *stiDocker) RemoveContainer(id string) error {
632633
ctx, cancel := getDefaultContext()
633634
defer cancel()
634-
opts := dockertypes.ContainerRemoveOptions{
635+
opts := dockercontainer.RemoveOptions{
635636
RemoveVolumes: true,
636637
}
637638
return d.client.ContainerRemove(ctx, id, opts)
@@ -1040,7 +1041,7 @@ func (d *stiDocker) RunContainer(opts RunContainerOptions) error {
10401041
log.V(2).Infof("Starting container %q ...", container.ID)
10411042
ctx, cancel = getDefaultContext()
10421043
defer cancel()
1043-
err = d.client.ContainerStart(ctx, container.ID, dockertypes.ContainerStartOptions{})
1044+
err = d.client.ContainerStart(ctx, container.ID, dockercontainer.StartOptions{})
10441045
if err != nil {
10451046
return err
10461047
}
@@ -1115,7 +1116,7 @@ func (d *stiDocker) GetImageID(name string) (string, error) {
11151116
// CommitContainer commits a container to an image with a specific tag.
11161117
// The new image ID is returned
11171118
func (d *stiDocker) CommitContainer(opts CommitContainerOptions) (string, error) {
1118-
dockerOpts := dockertypes.ContainerCommitOptions{
1119+
dockerOpts := dockercontainer.CommitOptions{
11191120
Reference: opts.Repository,
11201121
}
11211122
if opts.Command != nil || opts.Entrypoint != nil {

pkg/docker/docker_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func TestCommitContainer(t *testing.T) {
7878
ContainerID: tst.containerID,
7979
Repository: tst.containerTag,
8080
}
81-
param := dockertypes.ContainerCommitOptions{
81+
param := dockercontainer.CommitOptions{
8282
Reference: tst.containerTag,
8383
}
8484
resp := dockertypes.IDResponse{

pkg/docker/test/client.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
dockertypes "github.com/docker/docker/api/types"
1414
dockercontainer "github.com/docker/docker/api/types/container"
15+
"github.com/docker/docker/api/types/image"
1516
dockernetwork "github.com/docker/docker/api/types/network"
1617
v1 "github.com/opencontainers/image-spec/specs-go/v1"
1718
"golang.org/x/net/context"
@@ -79,7 +80,7 @@ type FakeDockerClient struct {
7980
WaitContainerErrInspectJSON dockertypes.ContainerJSON
8081

8182
ContainerCommitID string
82-
ContainerCommitOptions dockertypes.ContainerCommitOptions
83+
ContainerCommitOptions dockercontainer.CommitOptions
8384
ContainerCommitResponse dockertypes.IDResponse
8485
ContainerCommitErr error
8586

@@ -148,14 +149,14 @@ func (d *FakeDockerClient) ContainerWait(ctx context.Context, containerID string
148149
}
149150

150151
// ContainerCommit applies changes into a container and creates a new tagged image.
151-
func (d *FakeDockerClient) ContainerCommit(ctx context.Context, container string, options dockertypes.ContainerCommitOptions) (dockertypes.IDResponse, error) {
152+
func (d *FakeDockerClient) ContainerCommit(ctx context.Context, container string, options dockercontainer.CommitOptions) (dockertypes.IDResponse, error) {
152153
d.ContainerCommitID = container
153154
d.ContainerCommitOptions = options
154155
return d.ContainerCommitResponse, d.ContainerCommitErr
155156
}
156157

157158
// ContainerAttach attaches a connection to a container in the server.
158-
func (d *FakeDockerClient) ContainerAttach(ctx context.Context, container string, options dockertypes.ContainerAttachOptions) (dockertypes.HijackedResponse, error) {
159+
func (d *FakeDockerClient) ContainerAttach(ctx context.Context, container string, options dockercontainer.AttachOptions) (dockertypes.HijackedResponse, error) {
159160
d.Calls = append(d.Calls, "attach")
160161
return dockertypes.HijackedResponse{Conn: FakeConn{}, Reader: bufio.NewReader(&bytes.Buffer{})}, nil
161162
}
@@ -183,7 +184,7 @@ func (d *FakeDockerClient) ContainerInspect(ctx context.Context, containerID str
183184
}
184185

185186
// ContainerRemove kills and removes a container from the docker host.
186-
func (d *FakeDockerClient) ContainerRemove(ctx context.Context, containerID string, options dockertypes.ContainerRemoveOptions) error {
187+
func (d *FakeDockerClient) ContainerRemove(ctx context.Context, containerID string, options dockercontainer.RemoveOptions) error {
187188
d.Calls = append(d.Calls, "remove")
188189

189190
if _, exists := d.Containers[containerID]; exists {
@@ -199,7 +200,7 @@ func (d *FakeDockerClient) ContainerKill(ctx context.Context, containerID, signa
199200
}
200201

201202
// ContainerStart sends a request to the docker daemon to start a container.
202-
func (d *FakeDockerClient) ContainerStart(ctx context.Context, containerID string, options dockertypes.ContainerStartOptions) error {
203+
func (d *FakeDockerClient) ContainerStart(ctx context.Context, containerID string, options dockercontainer.StartOptions) error {
203204
d.Calls = append(d.Calls, "start")
204205
return nil
205206
}
@@ -216,14 +217,14 @@ func (d *FakeDockerClient) ImagePull(ctx context.Context, ref string, options do
216217
}
217218

218219
// ImageRemove removes an image from the docker host.
219-
func (d *FakeDockerClient) ImageRemove(ctx context.Context, imageID string, options dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDeleteResponseItem, error) {
220+
func (d *FakeDockerClient) ImageRemove(ctx context.Context, imageID string, options dockertypes.ImageRemoveOptions) ([]image.DeleteResponse, error) {
220221
d.Calls = append(d.Calls, "remove_image")
221222

222223
if _, exists := d.Images[imageID]; exists {
223224
delete(d.Images, imageID)
224-
return []dockertypes.ImageDeleteResponseItem{}, nil
225+
return []image.DeleteResponse{}, nil
225226
}
226-
return []dockertypes.ImageDeleteResponseItem{}, errors.New("image does not exist")
227+
return []image.DeleteResponse{}, errors.New("image does not exist")
227228
}
228229

229230
// ServerVersion returns information of the docker client and server host.

pkg/docker/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"regexp"
1414
"strings"
1515

16-
"github.com/docker/distribution/reference"
16+
"github.com/distribution/reference"
1717
"github.com/docker/docker/client"
1818
"github.com/docker/docker/pkg/homedir"
1919

vendor/github.com/docker/docker/AUTHORS

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

vendor/github.com/docker/docker/api/common.go

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

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

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

0 commit comments

Comments
 (0)