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:
haoyun
2022-01-07 10:19:31 +08:00
parent 3ccd43c8f6
commit bbe46b8c43
299 changed files with 1896 additions and 1874 deletions

View File

@@ -19,6 +19,8 @@ package containerd
import (
"archive/tar"
"context"
"errors"
"fmt"
"os"
"path/filepath"
"runtime"
@@ -28,7 +30,6 @@ import (
"github.com/containerd/containerd/archive/compression"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/pkg/errors"
)
// Install a binary image into the opt service
@@ -82,7 +83,7 @@ func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts)
}
if result && !config.Replace {
if _, err := os.Lstat(filepath.Join(path, hdr.Name)); err == nil {
return false, errors.Errorf("cannot replace %s in %s", hdr.Name, path)
return false, fmt.Errorf("cannot replace %s in %s", hdr.Name, path)
}
}
return result, nil