Skip to content

Commit

Permalink
update go 22 and fixing vul (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayja authored Sep 26, 2024
1 parent c502246 commit 137a3da
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Setup-go
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.22
- name: Checkout sources
uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
version: v1.59.1
args: --timeout=5m
11 changes: 9 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@

linters-settings:
revive:
rules:
- name: dot-imports
arguments:
- allowedPackages: # Allow dot imports for testing packages
- "github.com/onsi/ginkgo/v2"
- "github.com/onsi/gomega"
goconst:
min-len: 2
min-occurrences: 3
Expand All @@ -11,9 +18,9 @@ linters-settings:
- performance
- style
govet:
check-shadowing: true
enable:
- fieldalignment
- shadow
nolintlint:
require-explanation: true
require-specific: true
Expand Down Expand Up @@ -56,7 +63,7 @@ linters:

run:
issues-exit-code: 1
go: '1.21'
go: '1.22'
# skip-dirs:
# - sample
# skip-files:
Expand Down
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ $(LOCALBIN):
mkdir -p $(LOCALBIN)

GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.0
ENVTEST_K8S_VERSION = 1.27.1
GOLANGCI_LINT_VERSION ?= v1.59.1
ENVTEST_K8S_VERSION = 1.29.0

.PHONY: golanci-lint
golanci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
Expand Down
29 changes: 14 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ go 1.21
toolchain go1.21.8

require (
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.29.0
github.com/onsi/ginkgo/v2 v2.16.0
github.com/onsi/gomega v1.30.0
github.com/spf13/cobra v1.7.0
go.uber.org/zap v1.24.0
k8s.io/api v0.29.0
k8s.io/apiextensions-apiserver v0.29.0
k8s.io/apimachinery v0.29.0
k8s.io/client-go v0.29.0
sigs.k8s.io/controller-runtime v0.15.0
sigs.k8s.io/yaml v1.3.0
go.uber.org/zap v1.26.0
k8s.io/api v0.29.2
k8s.io/apiextensions-apiserver v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v0.29.2
sigs.k8s.io/controller-runtime v0.17.3
sigs.k8s.io/yaml v1.4.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
Expand All @@ -44,15 +44,14 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand Down
117 changes: 48 additions & 69 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/collectinfo/collectinfo_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ func compress(src string, buf io.Writer) error {
if fileErr != nil {
return fileErr
}

if _, fileErr := io.Copy(tw, data); fileErr != nil {
return fileErr
}
Expand Down
1 change: 1 addition & 0 deletions pkg/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (p *Parameters) ValidateNamespaces(ctx context.Context, namespaces []string
p.Logger.Warn(
fmt.Sprintf("namespaces %+v not present in cluster, skipping those namespaces",
nonExistentNs.UnsortedList()))

userNsSet = userNsSet.Difference(nonExistentNs)
}
}
Expand Down

0 comments on commit 137a3da

Please sign in to comment.