diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 13c674066..686cfbdef 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -294,7 +294,7 @@ func checkIfInstallable(ch *chart.Chart) error { case "", "application": return nil } - return errors.Errorf("%s charts are not installable", ch.Metadata.Type) + return fmt.Errorf("%s charts are not installable", ch.Metadata.Type) } // Provide dynamic auto-completion for the install and template commands diff --git a/cmd/helm/repo_remove.go b/cmd/helm/repo_remove.go index e6e9cb681..e714c4da4 100644 --- a/cmd/helm/repo_remove.go +++ b/cmd/helm/repo_remove.go @@ -17,12 +17,13 @@ limitations under the License. package main import ( + "errors" "fmt" "io" "os" "path/filepath" - "github.com/pkg/errors" + githubErrors "github.com/pkg/errors" "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/require" @@ -65,7 +66,7 @@ func (o *repoRemoveOptions) run(out io.Writer) error { for _, name := range o.names { if !r.Remove(name) { - return errors.Errorf("no repo named %q found", name) + return fmt.Errorf("no repo named %q found", name) } if err := r.WriteFile(o.repoFile, 0644); err != nil { return err @@ -90,7 +91,7 @@ func removeRepoCache(root, name string) error { if _, err := os.Stat(idx); os.IsNotExist(err) { return nil } else if err != nil { - return errors.Wrapf(err, "can't remove index file %s", idx) + return githubErrors.Wrapf(err, "can't remove index file %s", idx) } return os.Remove(idx) } diff --git a/cmd/helm/repo_update.go b/cmd/helm/repo_update.go index 27661674c..981343f13 100644 --- a/cmd/helm/repo_update.go +++ b/cmd/helm/repo_update.go @@ -17,11 +17,12 @@ limitations under the License. package main import ( + "errors" "fmt" "io" "sync" - "github.com/pkg/errors" + githubErrors "github.com/pkg/errors" "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/require" @@ -83,7 +84,7 @@ func (o *repoUpdateOptions) run(out io.Writer) error { case isNotExist(err): return errNoRepositories case err != nil: - return errors.Wrapf(err, "failed loading file: %s", o.repoFile) + return githubErrors.Wrapf(err, "failed loading file: %s", o.repoFile) case len(f.Repositories) == 0: return errNoRepositories } @@ -133,7 +134,7 @@ func updateCharts(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdate wg.Wait() if len(repoFailList) > 0 && failOnRepoUpdateFail { - return fmt.Errorf("Failed to update the following repositories: %s", + return fmt.Errorf("failed to update the following repositories: %s", repoFailList) } @@ -151,7 +152,7 @@ func checkRequestedRepos(requestedRepos []string, validRepos []*repo.Entry) erro } } if !found { - return errors.Errorf("no repositories found matching '%s'. Nothing will be updated", requestedRepo) + return fmt.Errorf("no repositories found matching '%s'. Nothing will be updated", requestedRepo) } } return nil diff --git a/cmd/helm/search_repo.go b/cmd/helm/search_repo.go index 4b11b8807..ed24aa59a 100644 --- a/cmd/helm/search_repo.go +++ b/cmd/helm/search_repo.go @@ -19,6 +19,7 @@ package main import ( "bufio" "bytes" + "errors" "fmt" "io" "os" @@ -27,7 +28,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/gosuri/uitable" - "github.com/pkg/errors" + githubErrors "github.com/pkg/errors" "github.com/spf13/cobra" "helm.sh/helm/v3/cmd/helm/search" @@ -149,7 +150,7 @@ func (o *searchRepoOptions) applyConstraint(res []*search.Result) ([]*search.Res constraint, err := semver.NewConstraint(o.version) if err != nil { - return res, errors.Wrap(err, "an invalid version/constraint format") + return res, githubErrors.Wrap(err, "an invalid version/constraint format") } data := res[:0]