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,12 +20,14 @@ import (
|
||||
"context"
|
||||
|
||||
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/errdefs/pkg/errgrpc"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
|
||||
"github.com/containerd/containerd/v2/core/diff"
|
||||
"github.com/containerd/containerd/v2/core/mount"
|
||||
"github.com/containerd/containerd/v2/pkg/oci"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
@@ -42,7 +44,7 @@ func FromApplierAndComparer(a diff.Applier, c diff.Comparer) diffapi.DiffServer
|
||||
}
|
||||
func (s *service) Apply(ctx context.Context, er *diffapi.ApplyRequest) (*diffapi.ApplyResponse, error) {
|
||||
if s.applier == nil {
|
||||
return nil, errdefs.ToGRPC(errdefs.ErrNotImplemented)
|
||||
return nil, errgrpc.ToGRPC(errdefs.ErrNotImplemented)
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -64,7 +66,7 @@ func (s *service) Apply(ctx context.Context, er *diffapi.ApplyRequest) (*diffapi
|
||||
|
||||
ocidesc, err = s.applier.Apply(ctx, desc, mounts, opts...)
|
||||
if err != nil {
|
||||
return nil, errdefs.ToGRPC(err)
|
||||
return nil, errgrpc.ToGRPC(err)
|
||||
}
|
||||
|
||||
return &diffapi.ApplyResponse{
|
||||
@@ -74,7 +76,7 @@ func (s *service) Apply(ctx context.Context, er *diffapi.ApplyRequest) (*diffapi
|
||||
|
||||
func (s *service) Diff(ctx context.Context, dr *diffapi.DiffRequest) (*diffapi.DiffResponse, error) {
|
||||
if s.comparer == nil {
|
||||
return nil, errdefs.ToGRPC(errdefs.ErrNotImplemented)
|
||||
return nil, errgrpc.ToGRPC(errdefs.ErrNotImplemented)
|
||||
}
|
||||
var (
|
||||
ocidesc ocispec.Descriptor
|
||||
@@ -100,7 +102,7 @@ func (s *service) Diff(ctx context.Context, dr *diffapi.DiffRequest) (*diffapi.D
|
||||
|
||||
ocidesc, err = s.comparer.Compare(ctx, aMounts, bMounts, opts...)
|
||||
if err != nil {
|
||||
return nil, errdefs.ToGRPC(err)
|
||||
return nil, errgrpc.ToGRPC(err)
|
||||
}
|
||||
|
||||
return &diffapi.DiffResponse{
|
||||
|
||||
Reference in New Issue
Block a user