replace as many github error deps as possible from cmd/helm

Signed-off-by: James Sheppard <jgsheppa@protonmail.com>
pull/12063/head
James Sheppard 2 years ago
parent be97863cf8
commit 5a1c5f737c

@ -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

@ -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)
}

@ -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

@ -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]

Loading…
Cancel
Save