replace as many github error deps as possible from pkg/plugin

Signed-off-by: James Sheppard <jgsheppa@protonmail.com>
pull/12063/head
James Sheppard 2 years ago
parent 7fdd78e370
commit 6e83ff0d46

@ -19,6 +19,7 @@ import (
"archive/tar" "archive/tar"
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"errors"
"fmt" "fmt"
"io" "io"
"os" "os"
@ -28,7 +29,7 @@ import (
"strings" "strings"
securejoin "github.com/cyphar/filepath-securejoin" securejoin "github.com/cyphar/filepath-securejoin"
"github.com/pkg/errors" githubErrors "github.com/pkg/errors"
"helm.sh/helm/v3/internal/third_party/dep/fs" "helm.sh/helm/v3/internal/third_party/dep/fs"
"helm.sh/helm/v3/pkg/cli" "helm.sh/helm/v3/pkg/cli"
@ -133,7 +134,7 @@ func (i *HTTPInstaller) Install() error {
} }
if err := i.extractor.Extract(pluginData, i.CacheDir); err != nil { if err := i.extractor.Extract(pluginData, i.CacheDir); err != nil {
return errors.Wrap(err, "extracting files from archive") return githubErrors.Wrap(err, "extracting files from archive")
} }
if !isPlugin(i.CacheDir) { if !isPlugin(i.CacheDir) {

@ -16,10 +16,11 @@ limitations under the License.
package installer // import "helm.sh/helm/v3/pkg/plugin/installer" package installer // import "helm.sh/helm/v3/pkg/plugin/installer"
import ( import (
"errors"
"os" "os"
"path/filepath" "path/filepath"
"github.com/pkg/errors" githubErrors "github.com/pkg/errors"
) )
// ErrPluginNotAFolder indicates that the plugin path is not a folder. // ErrPluginNotAFolder indicates that the plugin path is not a folder.
@ -34,7 +35,7 @@ type LocalInstaller struct {
func NewLocalInstaller(source string) (*LocalInstaller, error) { func NewLocalInstaller(source string) (*LocalInstaller, error) {
src, err := filepath.Abs(source) src, err := filepath.Abs(source)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "unable to get absolute path to plugin") return nil, githubErrors.Wrap(err, "unable to get absolute path to plugin")
} }
i := &LocalInstaller{ i := &LocalInstaller{
base: newBase(src), base: newBase(src),

Loading…
Cancel
Save