Update errdefs to 0.3.0
Uses the new github.com/containerd/errdefs/pkg module which is intended to hold less stable utility functions separately from the stable github.com/containerd/errdefs error types. Includes temporary update to hcsshim until a release is cut there Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -20,15 +20,16 @@ import (
|
||||
"context"
|
||||
|
||||
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
||||
"github.com/containerd/errdefs/pkg/errgrpc"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
||||
"github.com/containerd/containerd/v2/core/diff"
|
||||
"github.com/containerd/containerd/v2/core/mount"
|
||||
"github.com/containerd/containerd/v2/pkg/epoch"
|
||||
"github.com/containerd/containerd/v2/pkg/oci"
|
||||
ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
// NewDiffApplier returns a new comparer and applier which communicates
|
||||
@@ -64,7 +65,7 @@ func (r *diffRemote) Apply(ctx context.Context, desc ocispec.Descriptor, mounts
|
||||
}
|
||||
resp, err := r.client.Apply(ctx, req)
|
||||
if err != nil {
|
||||
return ocispec.Descriptor{}, errdefs.FromGRPC(err)
|
||||
return ocispec.Descriptor{}, errgrpc.ToNative(err)
|
||||
}
|
||||
return oci.DescriptorFromProto(resp.Applied), nil
|
||||
}
|
||||
@@ -93,7 +94,7 @@ func (r *diffRemote) Compare(ctx context.Context, a, b []mount.Mount, opts ...di
|
||||
}
|
||||
resp, err := r.client.Diff(ctx, req)
|
||||
if err != nil {
|
||||
return ocispec.Descriptor{}, errdefs.FromGRPC(err)
|
||||
return ocispec.Descriptor{}, errgrpc.ToNative(err)
|
||||
}
|
||||
return oci.DescriptorFromProto(resp.Diff), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user