Skip to content

Commit

Permalink
chore: update gomodguard configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Jun 5, 2023
1 parent 124ea9f commit aa12943
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 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
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 aa12943

Please sign in to comment.