Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump github.com/docker/docker from 25.0.5+incompatible to 26.0.0+incompatible #907

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 7e6f6e774e29406da95bd61cdcdbc8bc
commit: ee48893a270147348e3edc6c1a03de0e
6 changes: 3 additions & 3 deletions cmd/tink-worker/worker/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"path"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/registry"
"github.com/pkg/errors"
)
Expand All @@ -31,7 +31,7 @@ type ImagePullStatus struct {
}

// PullImage outputs to stdout the contents of the requested image (relative to the registry).
func (m *containerManager) PullImage(ctx context.Context, image string) error {
func (m *containerManager) PullImage(ctx context.Context, img string) error {
l := m.getLogger(ctx)
authConfig := registry.AuthConfig{
Username: m.registryDetails.Username,
Expand All @@ -44,7 +44,7 @@ func (m *containerManager) PullImage(ctx context.Context, image string) error {
}
authStr := base64.URLEncoding.EncodeToString(encodedJSON)

out, err := m.cli.ImagePull(ctx, path.Join(m.registryDetails.Registry, image), types.ImagePullOptions{RegistryAuth: authStr})
out, err := m.cli.ImagePull(ctx, path.Join(m.registryDetails.Registry, img), image.PullOptions{RegistryAuth: authStr})
if err != nil {
return errors.Wrap(err, "DOCKER PULL")
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/tink-worker/worker/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"strings"
"testing"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/image"
"github.com/go-logr/zapr"
"go.uber.org/zap"
)

func (c *fakeDockerClient) ImagePull(context.Context, string, types.ImagePullOptions) (io.ReadCloser, error) {
func (c *fakeDockerClient) ImagePull(context.Context, string, image.PullOptions) (io.ReadCloser, error) {
if c.err != nil {
return nil, c.err
}
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.21.4
require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/distribution/reference v0.5.0
github.com/docker/docker v25.0.5+incompatible
github.com/docker/docker v26.0.0+incompatible
github.com/equinix-labs/otel-init-go v0.0.9
github.com/go-logr/logr v1.4.1
github.com/go-logr/zapr v1.3.0
Expand Down Expand Up @@ -75,6 +75,7 @@ require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ github.com/dgryski/go-lttb v0.0.0-20180810165845-318fcdf10a77/go.mod h1:Va5MyIzk
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE=
github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -635,6 +635,8 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c=
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc=
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA=
Expand Down
8 changes: 4 additions & 4 deletions internal/agent/runtime/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"regexp"

retry "github.com/avast/retry-go"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/client"
"github.com/go-logr/logr"
Expand All @@ -31,15 +31,15 @@ type Docker struct {
func (d *Docker) Run(ctx context.Context, a workflow.Action) error {
pullImage := func() error {
// We need the image to be available before we can create a container.
image, err := d.client.ImagePull(ctx, a.Image, types.ImagePullOptions{})
img, err := d.client.ImagePull(ctx, a.Image, image.PullOptions{})
if err != nil {
return fmt.Errorf("docker: %w", err)
}
defer image.Close()
defer img.Close()

// Docker requires everything to be read from the images ReadCloser for the image to actually
// be pulled. We may want to log image pulls in a circular buffer somewhere for debugability.
if _, err = io.Copy(io.Discard, image); err != nil {
if _, err = io.Copy(io.Discard, img); err != nil {
return fmt.Errorf("docker: %w", err)
}

Expand Down
16 changes: 8 additions & 8 deletions internal/agent/runtime/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/tinkerbell/tink/internal/agent/workflow"
"go.uber.org/multierr"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
)

Expand All @@ -27,20 +27,20 @@ func TestDockerImageNotPresent(t *testing.T) {
t.Fatalf("Received unexpected error: %v", err)
}

image := "hello-world"
img := "hello-world"

images, err := clnt.ImageList(context.Background(), types.ImageListOptions{
Filters: filters.NewArgs(filters.Arg("reference", image)),
images, err := clnt.ImageList(context.Background(), image.ListOptions{
Filters: filters.NewArgs(filters.Arg("reference", img)),
})
if err != nil {
t.Fatalf("Unexpected error listing images: %v", err)
}

var errSum error
for _, image := range images {
_, err := clnt.ImageRemove(context.Background(), image.ID, types.ImageRemoveOptions{})
for _, img := range images {
_, err := clnt.ImageRemove(context.Background(), img.ID, image.RemoveOptions{})
if err != nil {
errSum = multierr.Append(errSum, fmt.Errorf("deleting image (%v): %v", image.ID, err))
errSum = multierr.Append(errSum, fmt.Errorf("deleting image (%v): %v", img.ID, err))
}
}
if errSum != nil {
Expand All @@ -55,7 +55,7 @@ func TestDockerImageNotPresent(t *testing.T) {

action := workflow.Action{
ID: "foobar",
Image: image,
Image: img,
}

err = rt.Run(context.Background(), action)
Expand Down
Loading