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:
@@ -17,8 +17,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
sandboxstore "github.com/containerd/containerd/pkg/cri/store/sandbox"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
runtime "k8s.io/cri-api/pkg/apis/runtime/v1"
|
||||
)
|
||||
@@ -35,12 +36,12 @@ func (c *criService) ListPodSandboxStats(
|
||||
metrics, err := metricsForSandbox(sandbox)
|
||||
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to obtain metrics for sandbox %q", sandbox.ID)
|
||||
return nil, fmt.Errorf("failed to obtain metrics for sandbox %q: %w", sandbox.ID, err)
|
||||
}
|
||||
|
||||
sandboxStats, err := c.podSandboxStats(ctx, sandbox, metrics)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to decode sandbox container metrics for sandbox %q", sandbox.ID)
|
||||
return nil, fmt.Errorf("failed to decode sandbox container metrics for sandbox %q: %w", sandbox.ID, err)
|
||||
}
|
||||
podSandboxStats.Stats = append(podSandboxStats.Stats, sandboxStats)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user