diff --git a/pkg/plugin/installer/http_installer.go b/pkg/plugin/installer/http_installer.go index 49274f83c..543955ca4 100644 --- a/pkg/plugin/installer/http_installer.go +++ b/pkg/plugin/installer/http_installer.go @@ -19,6 +19,7 @@ import ( "archive/tar" "bytes" "compress/gzip" + "fmt" "io" "os" "path" @@ -78,7 +79,7 @@ func NewExtractor(source string) (Extractor, error) { return extractor, nil } } - return nil, errors.Errorf("no extractor implemented yet for %s", source) + return nil, fmt.Errorf("no extractor implemented yet for %s", source) } // NewHTTPInstaller creates a new HttpInstaller. @@ -151,7 +152,7 @@ func (i *HTTPInstaller) Install() error { // Update updates a local repository // Not implemented for now since tarball most likely will be packaged by version func (i *HTTPInstaller) Update() error { - return errors.Errorf("method Update() not implemented for HttpInstaller") + return fmt.Errorf("method Update() not implemented for HttpInstaller") } // Path is overridden because we want to join on the plugin name not the file name @@ -261,7 +262,7 @@ func (g *TarGzExtractor) Extract(buffer *bytes.Buffer, targetDir string) error { case tar.TypeXGlobalHeader, tar.TypeXHeader: continue default: - return errors.Errorf("unknown type: %b in %s", header.Typeflag, header.Name) + return fmt.Errorf("unknown type: %b in %s", header.Typeflag, header.Name) } } return nil diff --git a/pkg/plugin/installer/http_installer_test.go b/pkg/plugin/installer/http_installer_test.go index 165007af0..6bb47b0fc 100644 --- a/pkg/plugin/installer/http_installer_test.go +++ b/pkg/plugin/installer/http_installer_test.go @@ -29,8 +29,6 @@ import ( "syscall" "testing" - "github.com/pkg/errors" - "helm.sh/helm/v3/internal/test/ensure" "helm.sh/helm/v3/pkg/getter" "helm.sh/helm/v3/pkg/helmpath" @@ -150,7 +148,7 @@ func TestHTTPInstallerNonExistentVersion(t *testing.T) { // inject fake http client responding with error httpInstaller.getter = &TestHTTPGetter{ - MockError: errors.Errorf("failed to download plugin for some reason"), + MockError: fmt.Errorf("failed to download plugin for some reason"), } // attempt to install the plugin diff --git a/pkg/plugin/installer/installer.go b/pkg/plugin/installer/installer.go index 6f01494e5..a738311ad 100644 --- a/pkg/plugin/installer/installer.go +++ b/pkg/plugin/installer/installer.go @@ -16,6 +16,7 @@ limitations under the License. package installer import ( + "errors" "fmt" "log" "net/http" @@ -23,8 +24,6 @@ import ( "path/filepath" "strings" - "github.com/pkg/errors" - "helm.sh/helm/v3/pkg/plugin" ) diff --git a/pkg/plugin/installer/vcs_installer.go b/pkg/plugin/installer/vcs_installer.go index f7df5b322..96658665b 100644 --- a/pkg/plugin/installer/vcs_installer.go +++ b/pkg/plugin/installer/vcs_installer.go @@ -16,12 +16,13 @@ limitations under the License. package installer // import "helm.sh/helm/v3/pkg/plugin/installer" import ( + "errors" + "fmt" "os" "sort" "github.com/Masterminds/semver/v3" "github.com/Masterminds/vcs" - "github.com/pkg/errors" "helm.sh/helm/v3/internal/third_party/dep/fs" "helm.sh/helm/v3/pkg/helmpath" @@ -144,7 +145,7 @@ func (i *VCSInstaller) solveVersion(repo vcs.Repo) (string, error) { } } - return "", errors.Errorf("requested version %q does not exist for plugin %q", i.Version, i.Repo.Remote()) + return "", fmt.Errorf("requested version %q does not exist for plugin %q", i.Version, i.Repo.Remote()) } // setVersion attempts to checkout the version