Skip to content

Commit

Permalink
vendor: github.com/containerd/containerd v1.7.6
Browse files Browse the repository at this point in the history
The DeepEqual ignore required in the daemon tests is a bit ugly, but it
works given the new protoc output.

We also have to ignore lints related to schema1 deprecations; these do
not apply as we must continue to support this schema version.

Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
  • Loading branch information
neersighted committed Sep 21, 2023
1 parent 79a4cbb commit fd6dd69
Show file tree
Hide file tree
Showing 508 changed files with 52,036 additions and 64,483 deletions.
2 changes: 1 addition & 1 deletion builder/builder-next/adapters/containerimage/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
ctdreference "github.com/containerd/containerd/reference"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
"github.com/containerd/containerd/remotes/docker/schema1"
"github.com/containerd/containerd/remotes/docker/schema1" //nolint:staticcheck // Ignore SA1019: "github.com/containerd/containerd/remotes/docker/schema1" is deprecated: use images formatted in Docker Image Manifest v2, Schema 2, or OCI Image Spec v1.
distreference "github.com/distribution/reference"
dimages "github.com/docker/docker/daemon/images"
"github.com/docker/docker/distribution/metadata"
Expand Down
2 changes: 1 addition & 1 deletion daemon/containerd/image_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (i *ImageService) PullImage(ctx context.Context, ref reference.Named, platf

// Allow pulling application/vnd.docker.distribution.manifest.v1+prettyjws images
// by converting them to OCI manifests.
opts = append(opts, containerd.WithSchema1Conversion)
opts = append(opts, containerd.WithSchema1Conversion) //nolint:staticcheck // Ignore SA1019: containerd.WithSchema1Conversion is deprecated: use Schema 2 or OCI images.

img, err := i.client.Pull(ctx, ref.String(), opts...)
if err != nil {
Expand Down
11 changes: 8 additions & 3 deletions daemon/runtime_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (
"github.com/docker/docker/api/types/system"
"github.com/docker/docker/daemon/config"
"github.com/docker/docker/errdefs"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/imdario/mergo"
"google.golang.org/protobuf/proto"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
)
Expand Down Expand Up @@ -242,11 +244,11 @@ func TestGetRuntime(t *testing.T) {
assert.Assert(t, ok, "stock runtime could not be found (test needs to be updated)")
stockRuntime.Features = nil

configdOpts := *stockRuntime.Opts.(*v2runcoptions.Options)
configdOpts := proto.Clone(stockRuntime.Opts.(*v2runcoptions.Options)).(*v2runcoptions.Options)
configdOpts.BinaryName = configuredRuntime.Path
wantConfigdRuntime := &shimConfig{
Shim: stockRuntime.Shim,
Opts: &configdOpts,
Opts: configdOpts,
}

for _, tt := range []struct {
Expand Down Expand Up @@ -334,7 +336,10 @@ func TestGetRuntime(t *testing.T) {
if tt.want != nil {
assert.Check(t, err)
got := &shimConfig{Shim: shim, Opts: opts}
assert.Check(t, is.DeepEqual(got, tt.want))
assert.Check(t, is.DeepEqual(got, tt.want,
cmpopts.IgnoreUnexported(runtimeoptions_v1.Options{}),
cmpopts.IgnoreUnexported(v2runcoptions.Options{}),
))
} else {
assert.Check(t, is.Equal(shim, ""))
assert.Check(t, is.Nil(opts))
Expand Down
17 changes: 10 additions & 7 deletions libcontainerd/remote/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ import (
cerrdefs "github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/protobuf"
v2runcoptions "github.com/containerd/containerd/runtime/v2/runc/options"
"github.com/containerd/typeurl/v2"
"github.com/docker/docker/errdefs"
"github.com/docker/docker/libcontainerd/queue"
libcontainerdtypes "github.com/docker/docker/libcontainerd/types"
"github.com/docker/docker/pkg/ioutils"
"github.com/hashicorp/go-multierror"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)

// DockerContainerBundlePath is the label key pointing to the container's bundle path
Expand Down Expand Up @@ -163,7 +166,7 @@ func (c *container) Start(ctx context.Context, checkpointDir string, withStdin b
// remove the checkpoint when we're done
defer func() {
if checkpoint != nil {
err := c.client.client.ContentStore().Delete(ctx, checkpoint.Digest)
err := c.client.client.ContentStore().Delete(ctx, digest.Digest(checkpoint.Digest))
if err != nil {
c.client.logger.WithError(err).WithFields(log.Fields{
"ref": checkpointDir,
Expand Down Expand Up @@ -205,10 +208,10 @@ func (c *container) Start(ctx context.Context, checkpointDir string, withStdin b
if runtime.GOOS != "windows" {
taskOpts = append(taskOpts, func(_ context.Context, _ *containerd.Client, info *containerd.TaskInfo) error {
if c.v2runcoptions != nil {
opts := *c.v2runcoptions
opts := proto.Clone(c.v2runcoptions).(*v2runcoptions.Options)
opts.IoUid = uint32(uid)
opts.IoGid = uint32(gid)
info.Options = &opts
info.Options = opts
}
return nil
})
Expand Down Expand Up @@ -342,7 +345,7 @@ func (t *task) Stats(ctx context.Context) (*libcontainerdtypes.Stats, error) {
if err != nil {
return nil, err
}
return libcontainerdtypes.InterfaceToStats(m.Timestamp, v), nil
return libcontainerdtypes.InterfaceToStats(protobuf.FromTimestamp(m.Timestamp), v), nil
}

func (t *task) Summary(ctx context.Context) ([]libcontainerdtypes.Summary, error) {
Expand Down Expand Up @@ -675,7 +678,7 @@ func (c *client) processEventStream(ctx context.Context, ns string) {
ProcessID: t.ID,
Pid: t.Pid,
ExitCode: t.ExitStatus,
ExitedAt: t.ExitedAt,
ExitedAt: protobuf.FromTimestamp(t.ExitedAt),
})
case *apievents.TaskOOM:
c.processEvent(ctx, libcontainerdtypes.EventOOM, libcontainerdtypes.EventInfo{
Expand Down Expand Up @@ -734,8 +737,8 @@ func (c *client) writeContent(ctx context.Context, mediaType, ref string, r io.R
}
return &types.Descriptor{
MediaType: mediaType,
Digest: writer.Digest(),
Size_: size,
Digest: writer.Digest().Encoded(),
Size: size,
}, nil
}

Expand Down
32 changes: 16 additions & 16 deletions vendor.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/cloudflare/cfssl v1.6.4
github.com/container-orchestrated-devices/container-device-interface v0.6.1
github.com/containerd/cgroups/v3 v3.0.2
github.com/containerd/containerd v1.6.24
github.com/containerd/containerd v1.7.6
github.com/containerd/continuity v0.4.2
github.com/containerd/fifo v1.1.0
github.com/containerd/typeurl/v2 v2.1.1
Expand Down Expand Up @@ -91,12 +91,12 @@ require (
github.com/vishvananda/netlink v1.2.1-beta.2
github.com/vishvananda/netns v0.0.4
go.etcd.io/bbolt v1.3.7
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
go.opentelemetry.io/otel v1.4.1
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1
go.opentelemetry.io/otel/sdk v1.4.1
go.opentelemetry.io/otel/trace v1.4.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.40.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.40.0
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0
go.opentelemetry.io/otel/sdk v1.14.0
go.opentelemetry.io/otel/trace v1.14.0
golang.org/x/mod v0.10.0
golang.org/x/net v0.10.0
golang.org/x/sync v0.3.0
Expand All @@ -105,6 +105,7 @@ require (
golang.org/x/time v0.3.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.56.2
google.golang.org/protobuf v1.31.0
gotest.tools/v3 v3.5.0
resenje.org/singleflight v0.4.0
)
Expand All @@ -113,6 +114,7 @@ require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 // indirect
github.com/armon/go-metrics v0.4.1 // indirect
Expand Down Expand Up @@ -155,7 +157,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
Expand Down Expand Up @@ -190,13 +192,12 @@ require (
go.etcd.io/etcd/raft/v3 v3.5.6 // indirect
go.etcd.io/etcd/server/v3 v3.5.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 // indirect
go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect
go.opentelemetry.io/otel/metric v0.27.0 // indirect
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.40.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect
go.opentelemetry.io/otel/metric v0.37.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
Expand All @@ -205,7 +206,6 @@ require (
golang.org/x/tools v0.8.0 // indirect
google.golang.org/api v0.114.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
Expand Down
Loading

0 comments on commit fd6dd69

Please sign in to comment.