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:
@@ -24,10 +24,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/api/services/tasks/v1"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/errdefs/pkg/errgrpc"
|
||||
|
||||
"github.com/containerd/containerd/v2/pkg/cio"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
"github.com/containerd/containerd/v2/pkg/tracing"
|
||||
"github.com/containerd/errdefs"
|
||||
)
|
||||
|
||||
// Process represents a system process
|
||||
@@ -134,7 +136,7 @@ func (p *process) Start(ctx context.Context) error {
|
||||
p.io.Wait()
|
||||
p.io.Close()
|
||||
}
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
span.SetAttributes(tracing.Attribute("process.pid", int(r.Pid)))
|
||||
p.pid = r.Pid
|
||||
@@ -160,7 +162,7 @@ func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts)
|
||||
ExecID: p.id,
|
||||
All: i.All,
|
||||
})
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
|
||||
func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) {
|
||||
@@ -206,7 +208,7 @@ func (p *process) CloseIO(ctx context.Context, opts ...IOCloserOpts) error {
|
||||
}
|
||||
r.Stdin = i.Stdin
|
||||
_, err := p.task.client.TaskService().CloseIO(ctx, r)
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
|
||||
func (p *process) IO() cio.IO {
|
||||
@@ -224,7 +226,7 @@ func (p *process) Resize(ctx context.Context, w, h uint32) error {
|
||||
Height: h,
|
||||
ExecID: p.id,
|
||||
})
|
||||
return errdefs.FromGRPC(err)
|
||||
return errgrpc.ToNative(err)
|
||||
}
|
||||
|
||||
func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitStatus, error) {
|
||||
@@ -250,7 +252,7 @@ func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitS
|
||||
ExecID: p.id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errdefs.FromGRPC(err)
|
||||
return nil, errgrpc.ToNative(err)
|
||||
}
|
||||
if p.io != nil {
|
||||
p.io.Cancel()
|
||||
@@ -266,7 +268,7 @@ func (p *process) Status(ctx context.Context) (Status, error) {
|
||||
ExecID: p.id,
|
||||
})
|
||||
if err != nil {
|
||||
return Status{}, errdefs.FromGRPC(err)
|
||||
return Status{}, errgrpc.ToNative(err)
|
||||
}
|
||||
status := ProcessStatus(strings.ToLower(r.Process.Status.String()))
|
||||
exitStatus := r.Process.ExitStatus
|
||||
|
||||
Reference in New Issue
Block a user