Skip to content

Commit

Permalink
[rel-1.2.0] Update go version to 1.22.2 (#119)
Browse files Browse the repository at this point in the history
* update go version to 1.22.2

* updated golangci yaml and added a suppress comment as early-return was not correct in highlighting an issue

* excluded test and mock directories from being scanned for tests

---------

Co-authored-by: Rishabh Patel <[email protected]>
Co-authored-by: Madhav Bhargava <[email protected]>
  • Loading branch information
3 people authored Apr 22, 2024
1 parent 1cf87f1 commit 9bd3229
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 145 deletions.
6 changes: 3 additions & 3 deletions .ci/pipeline_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ dependency-watchdog:
dockerfile: 'Dockerfile'
steps:
check:
image: 'golang:1.21.6'
image: 'golang:1.22.6'
test-unit:
image: 'golang:1.21.6'
image: 'golang:1.22.6'
build:
image: 'golang:1.21.6'
image: 'golang:1.22.6'
output_dir: 'binary'
jobs:
head-update:
Expand Down
20 changes: 17 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
run:
concurrency: 4
deadline: 10m
timeout: 10m

linters:
disable:
- unused
enable:
- revive
- ginkgolinter

issues:
exclude-use-default: false
exclude:
# errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
# revive
# revive:
- var-naming # ((var|const|struct field|func) .* should be .*
- dot-imports # should not use dot imports
- package-comments # package comment should be of the form
Expand All @@ -24,7 +23,22 @@ issues:
# typecheck:
- "undeclared name: `.*`"
- "\".*\" imported but not used"
# allow non-capitalized messages if they start with technical terms
- "structured logging message should be capitalized: \"garden(er-apiserver|er-controller-manager|er-admission-controller|er-operator|er-resource-manager|let)"
exclude-rules:
- linters:
- staticcheck
text: "SA1019:" # Excludes messages where deprecated variables are used

exclude-files:
- "zz_generated\\..*\\.go$"

linters-settings:
revive:
rules:
- name: duplicated-imports
- name: unused-parameter
- name: unreachable-code
- name: context-as-argument
- name: early-return
- name: exported
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.6 AS builder
FROM golang:1.22.2 AS builder

WORKDIR /go/src/github.com/gardener/dependency-watchdog
COPY . .
Expand Down
44 changes: 23 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module github.com/gardener/dependency-watchdog

go 1.21
go 1.22

require (
github.com/gardener/gardener v1.86.0
github.com/go-logr/logr v1.2.4
github.com/go-logr/logr v1.3.0
github.com/golang/mock v1.6.0
github.com/google/gnostic-models v0.6.8
github.com/hashicorp/go-multierror v1.1.1
github.com/onsi/gomega v1.29.0
go.uber.org/zap v1.26.0
k8s.io/api v0.28.3
k8s.io/apimachinery v0.28.3
k8s.io/client-go v0.28.3
k8s.io/code-generator v0.28.3
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
k8s.io/api v0.29.4
k8s.io/apimachinery v0.29.4
k8s.io/client-go v0.29.4
k8s.io/code-generator v0.29.4
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20231015215740-bf15e44028f9
sigs.k8s.io/kind v0.17.0
Expand Down Expand Up @@ -48,11 +48,12 @@ require (
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
Expand All @@ -69,6 +70,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
Expand All @@ -79,21 +81,21 @@ require (
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.10.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.13.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -102,13 +104,13 @@ require (
k8s.io/apiextensions-apiserver v0.28.3 // indirect
k8s.io/autoscaler/vertical-pod-autoscaler v1.0.0 // indirect
k8s.io/component-base v0.28.3 // indirect
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
k8s.io/helm v2.17.0+incompatible // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-aggregator v0.28.3 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kubelet v0.28.3 // indirect
k8s.io/metrics v0.28.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
Loading

0 comments on commit 9bd3229

Please sign in to comment.