Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 3 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.18.1
github.com/docker/cli v29.0.3+incompatible
github.com/docker/distribution v2.8.3+incompatible
github.com/docker/docker v28.5.2+incompatible
github.com/google/go-cmp v0.7.0
github.com/klauspost/compress v1.18.1
github.com/mitchellh/go-homedir v1.1.0
github.com/moby/docker-image-spec v1.3.1
github.com/moby/moby/api v1.52.0
github.com/moby/moby/client v0.2.1
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.1.1
github.com/spf13/cobra v1.10.1
Expand All @@ -24,34 +25,25 @@ require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker-credential-helpers v0.9.3 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-connections v0.6.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/moby/sys/atomicwriter v0.1.0 // indirect
github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/pflag v1.0.9 // indirect
github.com/vbatts/tar-split v0.12.2 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
google.golang.org/protobuf v1.36.3 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.0.3 // indirect
)
64 changes: 10 additions & 54 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/v1/daemon/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"sync"
"time"

api "github.com/docker/docker/api/types/image"
api "github.com/moby/moby/api/types/image"

"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
Expand Down Expand Up @@ -286,7 +286,7 @@
Architecture: inspect.Architecture,
Author: inspect.Author,
Created: v1.Time{Time: created},
DockerVersion: inspect.DockerVersion, //nolint:staticcheck // Field will be removed in next release

Check failure on line 289 in pkg/v1/daemon/image.go

View workflow job for this annotation

GitHub Actions / Build

inspect.DockerVersion undefined (type image.InspectResponse has no field or method DockerVersion)

Check failure on line 289 in pkg/v1/daemon/image.go

View workflow job for this annotation

GitHub Actions / Presubmit

inspect.DockerVersion undefined (type image.InspectResponse has no field or method DockerVersion)

Check failure on line 289 in pkg/v1/daemon/image.go

View workflow job for this annotation

GitHub Actions / Lint

inspect.DockerVersion undefined (type image.InspectResponse has no field or method DockerVersion) (typecheck)

Check failure on line 289 in pkg/v1/daemon/image.go

View workflow job for this annotation

GitHub Actions / Unit Tests

inspect.DockerVersion undefined (type image.InspectResponse has no field or method DockerVersion)
History: history,
OS: inspect.Os,
RootFS: v1.RootFS{
Expand Down
6 changes: 3 additions & 3 deletions pkg/v1/daemon/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"strings"
"testing"

api "github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/storage"
"github.com/docker/docker/client"
specs "github.com/moby/docker-image-spec/specs-go/v1"
api "github.com/moby/moby/api/types/image"
"github.com/moby/moby/api/types/storage"
"github.com/moby/moby/client"

"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/compare"
Expand All @@ -47,9 +47,9 @@
Architecture: "amd64",
Os: "linux",
Size: 8,
VirtualSize: 8,

Check failure on line 50 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

unknown field VirtualSize in struct literal of type image.InspectResponse

Check failure on line 50 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Lint

unknown field VirtualSize in struct literal of type image.InspectResponse

Check failure on line 50 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

unknown field VirtualSize in struct literal of type image.InspectResponse
Config: &specs.DockerOCIImageConfig{},
GraphDriver: storage.DriverData{

Check failure on line 52 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

cannot use storage.DriverData{…} (value of struct type storage.DriverData) as *storage.DriverData value in struct literal

Check failure on line 52 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use storage.DriverData{…} (value of struct type storage.DriverData) as *storage.DriverData value in struct literal

Check failure on line 52 in pkg/v1/daemon/image_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

cannot use storage.DriverData{…} (value of struct type storage.DriverData) as *storage.DriverData value in struct literal
Data: map[string]string{
"MergedDir": "/var/lib/docker/overlay2/988ecd005d048fd47b241dd57687231859563ba65a1dfd01ae1771ebfc4cb7c5/merged",
"UpperDir": "/var/lib/docker/overlay2/988ecd005d048fd47b241dd57687231859563ba65a1dfd01ae1771ebfc4cb7c5/diff",
Expand Down
6 changes: 3 additions & 3 deletions pkg/v1/daemon/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"context"
"io"

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

// ImageOption is an alias for Option.
Expand All @@ -36,7 +36,7 @@
}

var defaultClient = func() (Client, error) {
return client.NewClientWithOpts(client.FromEnv)

Check failure on line 39 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Build

cannot use client.NewClientWithOpts(client.FromEnv) (value of type *client.Client) as Client value in return statement: *client.Client does not implement Client (wrong type for method ImageHistory)

Check failure on line 39 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Presubmit

cannot use client.NewClientWithOpts(client.FromEnv) (value of type *client.Client) as Client value in return statement: *client.Client does not implement Client (wrong type for method ImageHistory)

Check failure on line 39 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Lint

cannot use client.NewClientWithOpts(client.FromEnv) (value of type *client.Client) as Client value in return statement: *client.Client does not implement Client (wrong type for method ImageHistory)

Check failure on line 39 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Unit Tests

cannot use client.NewClientWithOpts(client.FromEnv) (value of type *client.Client) as Client value in return statement: *client.Client does not implement Client (wrong type for method ImageHistory)
}

func makeOptions(opts ...Option) (*options, error) {
Expand Down Expand Up @@ -76,7 +76,7 @@

// WithClient is a functional option to allow injecting a docker client.
//
// By default, github.com/docker/docker/client.FromEnv is used.
// By default, github.com/moby/moby/client.FromEnv is used.
func WithClient(client Client) Option {
return func(o *options) {
o.client = client
Expand All @@ -97,7 +97,7 @@
type Client interface {
NegotiateAPIVersion(ctx context.Context)
ImageSave(context.Context, []string, ...client.ImageSaveOption) (io.ReadCloser, error)
ImageLoad(context.Context, io.Reader, ...client.ImageLoadOption) (api.LoadResponse, error)

Check failure on line 100 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Build

undefined: api.LoadResponse

Check failure on line 100 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Presubmit

undefined: api.LoadResponse

Check failure on line 100 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: api.LoadResponse

Check failure on line 100 in pkg/v1/daemon/options.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: api.LoadResponse
ImageTag(context.Context, string, string) error
ImageInspectWithRaw(context.Context, string) (api.InspectResponse, []byte, error)
ImageHistory(context.Context, string, ...client.ImageHistoryOption) ([]api.HistoryResponseItem, error)
Expand Down
2 changes: 1 addition & 1 deletion pkg/v1/daemon/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"fmt"
"io"

"github.com/docker/docker/client"
"github.com/google/go-containerregistry/pkg/name"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/moby/moby/client"
)

// Tag adds a tag to an already existent image.
Expand Down
4 changes: 2 additions & 2 deletions pkg/v1/daemon/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"strings"
"testing"

api "github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
api "github.com/moby/moby/api/types/image"
"github.com/moby/moby/client"

"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/empty"
Expand All @@ -38,16 +38,16 @@
return 0, r.err
}

func (m *MockClient) ImageLoad(ctx context.Context, r io.Reader, _ ...client.ImageLoadOption) (api.LoadResponse, error) {

Check failure on line 41 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

undefined: api.LoadResponse

Check failure on line 41 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: api.LoadResponse

Check failure on line 41 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: api.LoadResponse
if !m.negotiated {
return api.LoadResponse{}, errors.New("you forgot to call NegotiateAPIVersion before calling ImageLoad")

Check failure on line 43 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

undefined: api.LoadResponse

Check failure on line 43 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: api.LoadResponse

Check failure on line 43 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: api.LoadResponse
}
if m.wantCtx != nil && m.wantCtx != ctx {
return api.LoadResponse{}, fmt.Errorf("ImageLoad: wrong context")

Check failure on line 46 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

undefined: api.LoadResponse

Check failure on line 46 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: api.LoadResponse

Check failure on line 46 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: api.LoadResponse
}

_, _ = io.Copy(io.Discard, r)
return api.LoadResponse{

Check failure on line 50 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Presubmit

undefined: api.LoadResponse

Check failure on line 50 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: api.LoadResponse

Check failure on line 50 in pkg/v1/daemon/write_test.go

View workflow job for this annotation

GitHub Actions / Unit Tests

undefined: api.LoadResponse
Body: m.loadBody,
}, m.loadErr
}
Expand Down
Loading
Loading