Skip to content

Commit

Permalink
chore: update gomodguard (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest authored Jun 6, 2023
1 parent fd275f7 commit e5c29a9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linters:
- gofumpt
- goimports
- gomnd
- gomodguard
- gosec
- govet
- importas
Expand Down Expand Up @@ -73,6 +74,25 @@ linters-settings:
rules:
- name: exported
disabled: false
gomodguard:
blocked:
modules:
- github.com/ghodss/yaml:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v2:
recommendations:
- sigs.k8s.io/yaml
- gopkg.in/yaml.v3:
recommendations:
- sigs.k8s.io/yaml
- github.com/pkg/errors:
recommenddations:
- fmt
- errors
- golang.org/x/net/context:
recommenddations:
- context
issues:
fix: true
# Independently of option `exclude` we use default exclude patterns,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/bombsimon/logrusr/v3 v3.1.0
github.com/gammazero/workerpool v1.1.3
github.com/go-logr/logr v1.2.4
github.com/pkg/errors v0.9.1
github.com/puzpuzpuz/xsync/v2 v2.4.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
Expand All @@ -20,6 +19,7 @@ require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
)

require (
Expand Down
7 changes: 3 additions & 4 deletions pkg/internal/meshdetect/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"sort"
"strings"

"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
discoveryv1 "k8s.io/api/discovery/v1"
"k8s.io/apimachinery/pkg/fields"
Expand Down Expand Up @@ -378,17 +377,17 @@ func (d *Detector) DetectServiceDistribution(ctx context.Context) (*ServiceDistr

serviceList, err := d.listAllServices(ctx, defaultPageSize)
if err != nil {
return nil, errors.Wrap(err, "failed to list services in cluster")
return nil, fmt.Errorf("failed to list services in cluster: %w", err)
}

endpointsPerSvc, err := d.listAllEndpointsPerService(ctx, defaultPageSize)
if err != nil {
return nil, errors.Wrap(err, "failed to list endpoints in cluster")
return nil, fmt.Errorf("failed to list endpoints in cluster: %w", err)
}

pods, err := d.listAllPods(ctx, defaultPageSize)
if err != nil {
return nil, errors.Wrap(err, "failed to list pods in cluster")
return nil, fmt.Errorf("failed to list pods in cluster: %w", err)
}

ret := &ServiceDistributionResults{
Expand Down

0 comments on commit e5c29a9

Please sign in to comment.