From 6d65ad8862a62483200a82ed99d48dc0db17da05 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 15 Jan 2025 13:43:19 -0500 Subject: [PATCH] don't use deprecated stuff Signed-off-by: Jason Hall --- pkg/v1/daemon/options.go | 2 +- pkg/v1/daemon/write_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/v1/daemon/options.go b/pkg/v1/daemon/options.go index b80646369..824bfe99c 100644 --- a/pkg/v1/daemon/options.go +++ b/pkg/v1/daemon/options.go @@ -98,7 +98,7 @@ func WithContext(ctx context.Context) Option { type Client interface { NegotiateAPIVersion(ctx context.Context) ImageSave(context.Context, []string) (io.ReadCloser, error) - ImageLoad(context.Context, io.Reader, bool) (types.ImageLoadResponse, error) + ImageLoad(context.Context, io.Reader, bool) (api.LoadResponse, error) ImageTag(context.Context, string, string) error ImageInspectWithRaw(context.Context, string) (types.ImageInspect, []byte, error) ImageHistory(context.Context, string) ([]api.HistoryResponseItem, error) diff --git a/pkg/v1/daemon/write_test.go b/pkg/v1/daemon/write_test.go index 6f70f7a27..6d38a9b57 100644 --- a/pkg/v1/daemon/write_test.go +++ b/pkg/v1/daemon/write_test.go @@ -22,7 +22,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types" + api "github.com/docker/docker/api/types/image" "github.com/google/go-containerregistry/pkg/name" "github.com/google/go-containerregistry/pkg/v1/empty" @@ -37,16 +37,16 @@ func (r *errReader) Read(_ []byte) (int, error) { return 0, r.err } -func (m *MockClient) ImageLoad(ctx context.Context, r io.Reader, _ bool) (types.ImageLoadResponse, error) { +func (m *MockClient) ImageLoad(ctx context.Context, r io.Reader, _ bool) (api.LoadResponse, error) { if !m.negotiated { - return types.ImageLoadResponse{}, errors.New("you forgot to call NegotiateAPIVersion before calling ImageLoad") + return api.LoadResponse{}, errors.New("you forgot to call NegotiateAPIVersion before calling ImageLoad") } if m.wantCtx != nil && m.wantCtx != ctx { - return types.ImageLoadResponse{}, fmt.Errorf("ImageLoad: wrong context") + return api.LoadResponse{}, fmt.Errorf("ImageLoad: wrong context") } _, _ = io.Copy(io.Discard, r) - return types.ImageLoadResponse{ + return api.LoadResponse{ Body: m.loadBody, }, m.loadErr }