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:
@@ -22,12 +22,14 @@ import (
|
||||
|
||||
api "github.com/containerd/containerd/api/services/events/v1"
|
||||
"github.com/containerd/containerd/api/types"
|
||||
"github.com/containerd/containerd/v2/core/events"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/errdefs/pkg/errgrpc"
|
||||
"github.com/containerd/ttrpc"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/containerd/containerd/v2/core/events"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
)
|
||||
|
||||
type EventService interface {
|
||||
@@ -73,7 +75,7 @@ func (p *grpcEventsProxy) Publish(ctx context.Context, topic string, event event
|
||||
Event: typeurl.MarshalProto(evt),
|
||||
}
|
||||
if _, err := p.client.Publish(ctx, req); err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -88,7 +90,7 @@ func (p *grpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelope
|
||||
},
|
||||
}
|
||||
if _, err := p.client.Forward(ctx, req); err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -154,7 +156,7 @@ func (p *ttrpcEventsProxy) Publish(ctx context.Context, topic string, event even
|
||||
Event: typeurl.MarshalProto(evt),
|
||||
}
|
||||
if _, err := p.client.Publish(ctx, req); err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -169,7 +171,7 @@ func (p *ttrpcEventsProxy) Forward(ctx context.Context, envelope *events.Envelop
|
||||
},
|
||||
}
|
||||
if _, err := p.client.Forward(ctx, req); err != nil {
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user