feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io> Co-authored-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
@@ -48,7 +48,6 @@ import (
|
||||
"github.com/containerd/typeurl"
|
||||
ptypes "github.com/gogo/protobuf/types"
|
||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -232,11 +231,11 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
|
||||
}
|
||||
labels := map[string]string{"runtime": container.Runtime.Name}
|
||||
if err := l.monitor.Monitor(c, labels); err != nil {
|
||||
return nil, errors.Wrap(err, "monitor task")
|
||||
return nil, fmt.Errorf("monitor task: %w", err)
|
||||
}
|
||||
pid, err := c.PID(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get task pid")
|
||||
return nil, fmt.Errorf("failed to get task pid: %w", err)
|
||||
}
|
||||
return &api.CreateTaskResponse{
|
||||
ContainerID: r.ContainerID,
|
||||
@@ -464,7 +463,7 @@ func (l *local) ListPids(ctx context.Context, r *api.ListPidsRequest, _ ...grpc.
|
||||
if p.Info != nil {
|
||||
a, err := typeurl.MarshalAny(p.Info)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to marshal process %d info", p.Pid)
|
||||
return nil, fmt.Errorf("failed to marshal process %d info: %w", p.Pid, err)
|
||||
}
|
||||
pInfo.Info = a
|
||||
}
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/runtime"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var tasksServiceRequires = []plugin.Type{
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
package tasks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
|
||||
"github.com/intel/goresctrl/pkg/rdt"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -44,7 +45,7 @@ func initRdt(configFilePath string) error {
|
||||
}
|
||||
|
||||
if err := rdt.Initialize(ResctrlPrefix); err != nil {
|
||||
return errors.Wrap(err, "RDT not enabled")
|
||||
return fmt.Errorf("RDT not enabled: %w", err)
|
||||
}
|
||||
|
||||
if err := rdt.SetConfigFromFile(configFilePath, true); err != nil {
|
||||
|
||||
@@ -18,12 +18,12 @@ package tasks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
api "github.com/containerd/containerd/api/services/tasks/v1"
|
||||
"github.com/containerd/containerd/plugin"
|
||||
"github.com/containerd/containerd/services"
|
||||
ptypes "github.com/gogo/protobuf/types"
|
||||
"github.com/pkg/errors"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user