Skip to content

Commit

Permalink
don't use deprecated stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <jason@chainguard.dev>
  • Loading branch information
imjasonh committed Jan 15, 2025
1 parent 05e57e3 commit 6d65ad8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/v1/daemon/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions pkg/v1/daemon/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
Expand Down

0 comments on commit 6d65ad8

Please sign in to comment.