Skip to content

Commit 85497c7

Browse files
committed
Update go to 1.20
Signed-off-by: Jonathan Marcantonio <[email protected]> Update k8s.io apis to v0.25.7 Signed-off-by: Jonathan Marcantonio <[email protected]> update client-go Signed-off-by: Jonathan Marcantonio <[email protected]> update linter Signed-off-by: Jonathan Marcantonio <[email protected]> Update linter again Signed-off-by: Jonathan Marcantonio <[email protected]> musttag linter Signed-off-by: Jonathan Marcantonio <[email protected]>
1 parent bbe6a51 commit 85497c7

32 files changed

+160
-152
lines changed

.github/workflows/go-postsubmit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# Common versions
11-
GO_VERSION: '1.19'
11+
GO_VERSION: '1.20'
1212
GO_REQUIRED_MIN_VERSION: ''
1313
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1414
defaults:

.github/workflows/go-presubmit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# Common versions
11-
GO_VERSION: '1.19'
11+
GO_VERSION: '1.20'
1212
GO_REQUIRED_MIN_VERSION: ''
1313
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1414
defaults:

.github/workflows/go-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*.*.*'
77
env:
88
# Common versions
9-
GO_VERSION: '1.19'
9+
GO_VERSION: '1.20'
1010
GO_REQUIRED_MIN_VERSION: ''
1111
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
1212
GITHUB_REF: ${{ github.ref }}

addon/addon.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const (
3434
AgentImageEnv = "OPERAND_IMAGE_MULTICLUSTER_OPERATORS_SUBSCRIPTION"
3535
)
3636

37-
//nolint
37+
//nolint:all
3838
//go:embed manifests
3939
//go:embed manifests/chart
4040
//go:embed manifests/chart/templates/_helpers.tpl
@@ -146,7 +146,7 @@ func newRegistrationOption(kubeClient *kubernetes.Clientset, addonName string) *
146146
}
147147
}
148148

149-
//nolint
149+
//nolint:all
150150
func applyManifestFromFile(file, clusterName, addonName string, kubeClient *kubernetes.Clientset) error {
151151
groups := agent.DefaultGroups(clusterName, addonName)
152152
config := struct {

addon/addon_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func newAgentAddon(t *testing.T) agent.AgentAddon {
7070
return agentAddon
7171
}
7272

73-
// nolint
73+
//nolint:all
7474
func TestManifest(t *testing.T) {
7575
tests := []struct {
7676
name string

build/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.ci.openshift.org/stolostron/builder:go1.19-linux AS plugin-builder
1+
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS plugin-builder
22
ENV POLICY_GENERATOR_TAG=v1.10.0
33

44
WORKDIR /policy-generator

build/Dockerfile.prow

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.ci.openshift.org/stolostron/builder:go1.19-linux AS builder
1+
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS builder
22
ENV POLICY_GENERATOR_TAG=v1.10.0
33

44
WORKDIR /go/src/github.com/stolostron/multicluster-operators-subscription

build/run-code-lint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gem install mdl
3737
gem install awesome_bot
3838

3939
# Install golangci-lint
40-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.46.2
40+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.51.2
4141

4242
# Start lint task
4343
make -f Makefile.prow lint-all

common/config/.golangci.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
service:
22
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo.
3-
golangci-lint-version: 1.46.x # use the fixed version to not introduce new linters unexpectedly
3+
golangci-lint-version: 1.51.x # use the fixed version to not introduce new linters unexpectedly
44
run:
55
# timeout for analysis, e.g. 30s, 5m, default is 1m
66
deadline: 20m
77
timeout: 20m
8-
go: '1.17'
98

109
# which dirs to skip: they won't be analyzed;
1110
# can use regexp here: generated.*, regexp is applied on full path;
@@ -33,6 +32,7 @@ linters:
3332
- bodyclose
3433
- contextcheck
3534
- cyclop
35+
- deadcode
3636
- depguard
3737
- dupl
3838
- forbidigo
@@ -43,6 +43,7 @@ linters:
4343
- exhaustivestruct
4444
- forcetypeassert
4545
- gci
46+
- ginkgolinter
4647
- gochecknoglobals
4748
- gochecknoinits
4849
- goconst
@@ -57,26 +58,34 @@ linters:
5758
- gosec
5859
- ifshort
5960
- ineffassign
61+
- interfacebloat
6062
- interfacer
6163
- ireturn
64+
- loggercheck
6265
- maintidx
6366
- maligned
67+
- musttag
6468
- nakedret
6569
- nestif
6670
- nilerr
6771
- nilnil
6872
- nlreturn
6973
- noctx
7074
- nonamedreturns
75+
- nosnakecase
7176
- paralleltest
7277
- prealloc
7378
- predeclared
74-
- staticcheck
79+
- rowserrcheck
7580
- scopelint
81+
- staticcheck
82+
- structcheck
7683
- tagliatelle
7784
- tenv
7885
- testpackage
7986
- thelper
87+
- usestdlibvars
88+
- varcheck
8089
- varnamelen
8190
- wastedassign
8291
- wrapcheck

common/scripts/lint_go.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2
17+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.2
1818

1919
export GOLANGCI_LINT_CACHE=/tmp/golangci-cache
2020
export GOROOT=`go env GOROOT`

go.mod

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module open-cluster-management.io/multicloud-operators-subscription
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/Masterminds/semver/v3 v3.1.1
@@ -23,15 +23,15 @@ require (
2323
github.com/spf13/pflag v1.0.5
2424
github.com/stretchr/testify v1.8.0
2525
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
26-
golang.org/x/net v0.0.0-20220728030405-41545e8bf201
26+
golang.org/x/net v0.7.0
2727
gomodules.xyz/jsonpatch/v3 v3.0.1
2828
gopkg.in/src-d/go-git.v4 v4.13.1
2929
helm.sh/helm/v3 v3.10.3
30-
k8s.io/api v0.25.2
31-
k8s.io/apiextensions-apiserver v0.25.2
32-
k8s.io/apimachinery v0.25.2
33-
k8s.io/cli-runtime v0.25.2
34-
k8s.io/client-go v12.0.0+incompatible
30+
k8s.io/api v0.25.7
31+
k8s.io/apiextensions-apiserver v0.25.7
32+
k8s.io/apimachinery v0.25.7
33+
k8s.io/cli-runtime v0.25.7
34+
k8s.io/client-go v0.25.7
3535
k8s.io/klog v1.0.0
3636
k8s.io/klog/v2 v2.70.1
3737
open-cluster-management.io/addon-framework v0.5.0
@@ -177,9 +177,9 @@ require (
177177
go.starlark.net v0.0.0-20220714194419-4cadf0a12139 // indirect
178178
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
179179
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
180-
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
181-
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
182-
golang.org/x/text v0.3.8 // indirect
180+
golang.org/x/sys v0.5.0 // indirect
181+
golang.org/x/term v0.5.0 // indirect
182+
golang.org/x/text v0.7.0 // indirect
183183
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
184184
golang.org/x/tools v0.1.12 // indirect
185185
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
@@ -193,8 +193,8 @@ require (
193193
gopkg.in/warnings.v0 v0.1.2 // indirect
194194
gopkg.in/yaml.v2 v2.4.0 // indirect
195195
gopkg.in/yaml.v3 v3.0.1 // indirect
196-
k8s.io/apiserver v0.25.2 // indirect
197-
k8s.io/component-base v0.25.2 // indirect
196+
k8s.io/apiserver v0.25.7 // indirect
197+
k8s.io/component-base v0.25.7 // indirect
198198
k8s.io/kube-aggregator v0.24.3 // indirect
199199
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
200200
k8s.io/kubectl v0.25.2 // indirect
@@ -205,5 +205,3 @@ require (
205205
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
206206
sigs.k8s.io/yaml v1.3.0 // indirect
207207
)
208-
209-
replace k8s.io/client-go => k8s.io/client-go v0.25.0

0 commit comments

Comments
 (0)