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:
@@ -22,12 +22,12 @@ package apparmor
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/containerd/containerd/containers"
|
||||
"github.com/containerd/containerd/oci"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// WithProfile sets the provided apparmor profile to the spec
|
||||
@@ -76,7 +76,7 @@ func LoadDefaultProfile(name string) error {
|
||||
return err
|
||||
}
|
||||
if err := load(path); err != nil {
|
||||
return errors.Wrapf(err, "load apparmor profile %s", path)
|
||||
return fmt.Errorf("load apparmor profile %s: %w", path, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@@ -21,11 +21,11 @@ package apparmor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/containerd/containerd/containers"
|
||||
"github.com/containerd/containerd/oci"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// WithProfile sets the provided apparmor profile to the spec
|
||||
|
@@ -31,7 +31,6 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
exec "golang.org/x/sys/execabs"
|
||||
)
|
||||
|
||||
@@ -125,7 +124,7 @@ func loadData(name string) (*data, error) {
|
||||
}
|
||||
ver, err := getVersion()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "get apparmor_parser version")
|
||||
return nil, fmt.Errorf("get apparmor_parser version: %w", err)
|
||||
}
|
||||
p.Version = ver
|
||||
|
||||
@@ -152,7 +151,7 @@ func generate(p *data, o io.Writer) error {
|
||||
func load(path string) error {
|
||||
out, err := aaParser("-Kr", path)
|
||||
if err != nil {
|
||||
return errors.Errorf("%s: %s", err, out)
|
||||
return fmt.Errorf("%s: %s", err, out)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user