Skip to content

Commit

Permalink
Merge pull request #844 from gy95/errors
Browse files Browse the repository at this point in the history
replace github.com/pkg/errors with Go native error
  • Loading branch information
karmada-bot authored Oct 21, 2021
2 parents d535f70 + 7452ca2 commit 9c891f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/kr/pretty v0.3.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.14.0
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
golang.org/x/tools v0.1.2
Expand Down
7 changes: 3 additions & 4 deletions pkg/karmadactl/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"
"sync"

"github.com/pkg/errors"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
Expand Down Expand Up @@ -213,7 +212,7 @@ func (g *CommandGetOptions) Run(karmadaConfig KarmadaConfig, cmd *cobra.Command,
}

if err := g.getSecretTokenInKarmada(karmadaclient, g.Clusters[idx], clusterInfos); err != nil {
return errors.Wrap(err, "Method getSecretTokenInKarmada get Secret info in karmada failed, err is")
return fmt.Errorf("Method getSecretTokenInKarmada get Secret info in karmada failed, err is: %w", err)
}
f := getFactory(g.Clusters[idx], clusterInfos)
go g.getObjInfo(&wg, &mux, f, g.Clusters[idx], &objs, &allErrs, args)
Expand Down Expand Up @@ -396,11 +395,11 @@ type ClusterInfo struct {
func clusterInfoInit(g *CommandGetOptions, karmadaConfig KarmadaConfig, clusterInfos map[string]*ClusterInfo) (*rest.Config, error) {
karmadaclient, err := karmadaConfig.GetRestConfig(g.KarmadaContext, g.KubeConfig)
if err != nil {
return nil, errors.Wrap(err, "Func GetRestConfig get karmada client failed, err is")
return nil, fmt.Errorf("Func GetRestConfig get karmada client failed, err is: %w", err)
}

if err := getClusterInKarmada(karmadaclient, clusterInfos); err != nil {
return nil, errors.Wrap(err, "Method getClusterInKarmada get cluster info in karmada failed, err is")
return nil, fmt.Errorf("Method getClusterInKarmada get cluster info in karmada failed, err is: %w", err)
}

if err := getRBInKarmada(g.Namespace, karmadaclient); err != nil {
Expand Down

0 comments on commit 9c891f5

Please sign in to comment.