Skip to content

Commit 744bbba

Browse files
authored
Update to Go 1.24.2, golangci-lint 2.x (#1914)
* migrate golangci-lint config * adjust code to new linter settings * bump to Go 1.24.2 * treat the SDK the same way
1 parent 30362bb commit 744bbba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+251
-219
lines changed

.gimps.yaml

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

15-
# This is the configuration for https://github.com/xrstf/gimps.
15+
# This is the configuration for https://codeberg.org/xrstf/gimps.
1616

1717
importOrder: [std, external, kubermatic, kubernetes]
1818
sets:

.golangci.yml

+81-65
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
version: "2"
12
run:
2-
timeout: 20m
33
build-tags:
44
- e2e
55
linters:
6+
default: none
67
enable:
78
- asciicheck
89
- bidichk
@@ -15,8 +16,6 @@ linters:
1516
- goconst
1617
- gocyclo
1718
- godot
18-
- gofmt
19-
- gosimple
2019
- govet
2120
- importas
2221
- ineffassign
@@ -27,73 +26,90 @@ linters:
2726
- nosprintfhostport
2827
- predeclared
2928
- promlinter
30-
- revive
3129
- staticcheck
32-
- tenv
3330
- unconvert
3431
- unused
3532
- wastedassign
3633
- whitespace
37-
disable-all: true
38-
39-
linters-settings:
40-
depguard:
41-
rules:
42-
main:
43-
deny:
44-
- { pkg: io/ioutil, desc: https://go.dev/doc/go1.16#ioutil }
45-
- { pkg: github.com/ghodss/yaml, desc: use sigs.k8s.io/yaml instead }
46-
47-
revive:
34+
settings:
35+
depguard:
36+
rules:
37+
main:
38+
deny:
39+
- pkg: io/ioutil
40+
desc: https://go.dev/doc/go1.16#ioutil
41+
- pkg: github.com/ghodss/yaml
42+
desc: use sigs.k8s.io/yaml instead
43+
govet:
44+
enable:
45+
- nilness # find tautologies / impossible conditions
46+
importas:
47+
alias:
48+
# Machine Controller
49+
- pkg: k8c.io/machine-controller/sdk/apis/(\w+)/(v[\w\d]+)
50+
alias: $1$2
51+
# Kubernetes
52+
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
53+
alias: $1$2
54+
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
55+
alias: metav1
56+
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
57+
alias: apiextensionsv1
58+
- pkg: k8s.io/apimachinery/pkg/api/errors
59+
alias: apierrors
60+
- pkg: k8s.io/apimachinery/pkg/util/errors
61+
alias: kerrors
62+
# Controller Runtime
63+
- pkg: sigs.k8s.io/controller-runtime/pkg/client
64+
alias: ctrlruntimeclient
65+
# Other Kube APIs
66+
- pkg: go.anx.io/go-anxcloud/pkg/apis/(\w+)/(v[\w\d]+)
67+
alias: anx$1$2
68+
- pkg: github.com/tinkerbell/tink/api/(v[\w\d]+)
69+
alias: tink$1
70+
- pkg: kubevirt.io/api/(\w+)/(v[\w\d]+)
71+
alias: kubevirt$1$2
72+
- pkg: kubevirt.io/containerized-data-importer-api/pkg/apis/(\w+)/(v[\w\d]+)
73+
alias: cdi$1$2
74+
no-unaliased: true
75+
exclusions:
76+
generated: lax
77+
presets:
78+
- comments
79+
- common-false-positives
80+
- legacy
81+
- std-error-handling
4882
rules:
49-
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#add-constant
50-
- name: duplicated-imports
51-
severity: warning
52-
53-
govet:
54-
enable:
55-
- nilness # find tautologies / impossible conditions
56-
57-
importas:
58-
no-unaliased: true
59-
alias:
60-
# Machine Controller
61-
- pkg: k8c.io/machine-controller/sdk/apis/(\w+)/(v[\w\d]+)
62-
alias: $1$2
63-
# Kubernetes
64-
- pkg: k8s.io/api/(\w+)/(v[\w\d]+)
65-
alias: $1$2
66-
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
67-
alias: metav1
68-
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
69-
alias: apiextensionsv1
70-
- pkg: k8s.io/apimachinery/pkg/api/errors
71-
alias: apierrors
72-
- pkg: k8s.io/apimachinery/pkg/util/errors
73-
alias: kerrors
74-
# Controller Runtime
75-
- pkg: sigs.k8s.io/controller-runtime/pkg/client
76-
alias: ctrlruntimeclient
77-
# Other Kube APIs
78-
- pkg: go.anx.io/go-anxcloud/pkg/apis/(\w+)/(v[\w\d]+)
79-
alias: anx$1$2
80-
- pkg: github.com/tinkerbell/tink/api/(v[\w\d]+)
81-
alias: tink$1
82-
- pkg: kubevirt.io/api/(\w+)/(v[\w\d]+)
83-
alias: kubevirt$1$2
84-
- pkg: kubevirt.io/containerized-data-importer-api/pkg/apis/(\w+)/(v[\w\d]+)
85-
alias: cdi$1$2
86-
83+
- path: (.+)\.go$
84+
text: func Convert_MachinesV1alpha1Machine_To_ClusterV1alpha1Machine should be ConvertMachinesV1alpha1MachineToClusterV1alpha1Machine
85+
- path: (.+)\.go$
86+
text: func Convert_MachineDeployment_ProviderConfig_To_ProviderSpec should be ConvertMachineDeploymentProviderConfigToProviderSpec
87+
- path: (.+)\.go$
88+
text: func Convert_MachineSet_ProviderConfig_To_ProviderSpec should be ConvertMachineSetProviderConfigToProviderSpec
89+
- path: (.+)\.go$
90+
text: func Convert_Machine_ProviderConfig_To_ProviderSpec should be ConvertMachineProviderConfigToProviderSpec
91+
- path: (.+)\.go$
92+
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Create` is high
93+
- path: (.+)\.go$
94+
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Validate` is high
95+
- path: (.+)\.go$
96+
text: cyclomatic complexity [0-9]+ of func `\(\*provider\)\.getConfig` is high
97+
- path: (.+)\.go$
98+
text: 'SA1019: s.server.IPv6 is deprecated'
99+
paths:
100+
- apis/machines
101+
- third_party$
102+
- builtin$
103+
- examples$
87104
issues:
88105
max-same-issues: 0
89-
exclude:
90-
- func Convert_MachinesV1alpha1Machine_To_ClusterV1alpha1Machine should be ConvertMachinesV1alpha1MachineToClusterV1alpha1Machine
91-
- func Convert_MachineDeployment_ProviderConfig_To_ProviderSpec should be ConvertMachineDeploymentProviderConfigToProviderSpec
92-
- func Convert_MachineSet_ProviderConfig_To_ProviderSpec should be ConvertMachineSetProviderConfigToProviderSpec
93-
- func Convert_Machine_ProviderConfig_To_ProviderSpec should be ConvertMachineProviderConfigToProviderSpec
94-
- 'cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Create` is high'
95-
- 'cyclomatic complexity [0-9]+ of func `\(\*provider\)\.Validate` is high'
96-
- 'cyclomatic complexity [0-9]+ of func `\(\*provider\)\.getConfig` is high'
97-
- "SA1019: s.server.IPv6 is deprecated"
98-
exclude-dirs:
99-
- apis/machines
106+
formatters:
107+
enable:
108+
- gofmt
109+
exclusions:
110+
generated: lax
111+
paths:
112+
- apis/machines
113+
- third_party$
114+
- builtin$
115+
- examples$

.prow/e2e-features.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ presubmits:
3535
preset-kubeconfig-ci: "true"
3636
spec:
3737
containers:
38-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
38+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3939
command:
4040
- "./hack/ci/run-e2e-tests.sh"
4141
args:
@@ -65,7 +65,7 @@ presubmits:
6565
preset-kubeconfig-ci: "true"
6666
spec:
6767
containers:
68-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
68+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
6969
command:
7070
- "./hack/ci/run-e2e-tests.sh"
7171
args:
@@ -95,7 +95,7 @@ presubmits:
9595
preset-kubeconfig-ci: "true"
9696
spec:
9797
containers:
98-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
98+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
9999
command:
100100
- "./hack/ci/run-e2e-tests.sh"
101101
args:
@@ -123,7 +123,7 @@ presubmits:
123123
preset-kubeconfig-ci: "true"
124124
spec:
125125
containers:
126-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
126+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
127127
command:
128128
- "./hack/ci/run-e2e-tests.sh"
129129
args:

.prow/postsubmits.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ postsubmits:
2727
preset-goproxy: "true"
2828
spec:
2929
containers:
30-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
30+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3131
command:
3232
- /bin/bash
3333
- -c
@@ -56,7 +56,7 @@ postsubmits:
5656
preset-goproxy: "true"
5757
spec:
5858
containers:
59-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
59+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
6060
command:
6161
- "./hack/ci/upload-gocache.sh"
6262
resources:

.prow/provider-alibaba.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ presubmits:
3030
preset-kubeconfig-ci: "true"
3131
spec:
3232
containers:
33-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
33+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3434
command:
3535
- "./hack/ci/run-e2e-tests.sh"
3636
args:

.prow/provider-anexia.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ presubmits:
3232
preset-kubeconfig-ci: "true"
3333
spec:
3434
containers:
35-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
35+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3636
command:
3737
- "./hack/ci/run-e2e-tests.sh"
3838
args:

.prow/provider-aws.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ presubmits:
3030
preset-kubeconfig-ci: "true"
3131
spec:
3232
containers:
33-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
33+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3434
command:
3535
- "./hack/ci/run-e2e-tests.sh"
3636
args:
@@ -63,7 +63,7 @@ presubmits:
6363
preset-kubeconfig-ci: "true"
6464
spec:
6565
containers:
66-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
66+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
6767
command:
6868
- "./hack/ci/run-e2e-tests.sh"
6969
args:
@@ -96,7 +96,7 @@ presubmits:
9696
preset-kubeconfig-ci: "true"
9797
spec:
9898
containers:
99-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
99+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
100100
command:
101101
- "./hack/ci/run-e2e-tests.sh"
102102
args:
@@ -130,7 +130,7 @@ presubmits:
130130
preset-kubeconfig-ci: "true"
131131
spec:
132132
containers:
133-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
133+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
134134
command:
135135
- "./hack/ci/run-e2e-tests.sh"
136136
args:
@@ -162,7 +162,7 @@ presubmits:
162162
preset-kubeconfig-ci: "true"
163163
spec:
164164
containers:
165-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
165+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
166166
command:
167167
- "./hack/ci/run-e2e-tests.sh"
168168
args:
@@ -194,7 +194,7 @@ presubmits:
194194
preset-kubeconfig-ci: "true"
195195
spec:
196196
containers:
197-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
197+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
198198
command:
199199
- "./hack/ci/run-e2e-tests.sh"
200200
args:

.prow/provider-azure.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ presubmits:
2929
preset-kubeconfig-ci: "true"
3030
spec:
3131
containers:
32-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
32+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3333
command:
3434
- "./hack/ci/run-e2e-tests.sh"
3535
args:
@@ -62,7 +62,7 @@ presubmits:
6262
preset-kubeconfig-ci: "true"
6363
spec:
6464
containers:
65-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
65+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
6666
command:
6767
- "./hack/ci/run-e2e-tests.sh"
6868
args:
@@ -96,7 +96,7 @@ presubmits:
9696
preset-kubeconfig-ci: "true"
9797
spec:
9898
containers:
99-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
99+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
100100
command:
101101
- "./hack/ci/run-e2e-tests.sh"
102102
args:

.prow/provider-digitalocean.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ presubmits:
2828
preset-kubeconfig-ci: "true"
2929
spec:
3030
containers:
31-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
31+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3232
command:
3333
- "./hack/ci/run-e2e-tests.sh"
3434
args:

.prow/provider-equinix-metal.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ presubmits:
2929
preset-kubeconfig-ci: "true"
3030
spec:
3131
containers:
32-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
32+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3333
command:
3434
- "./hack/ci/run-e2e-tests.sh"
3535
args:

.prow/provider-gcp.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ presubmits:
2929
preset-kubeconfig-ci: "true"
3030
spec:
3131
containers:
32-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
32+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3333
command:
3434
- "./hack/ci/run-e2e-tests.sh"
3535
args:

.prow/provider-hetzner.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ presubmits:
2727
preset-kubeconfig-ci: "true"
2828
spec:
2929
containers:
30-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
30+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3131
command:
3232
- "./hack/ci/run-e2e-tests.sh"
3333
args:

.prow/provider-kubevirt.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ presubmits:
3131
preset-kubeconfig-ci: "true"
3232
spec:
3333
containers:
34-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
34+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3535
command:
3636
- "./hack/ci/run-e2e-tests.sh"
3737
args:

.prow/provider-linode.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ presubmits:
2929
preset-kubeconfig-ci: "true"
3030
spec:
3131
containers:
32-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
32+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3333
command:
3434
- "./hack/ci/run-e2e-tests.sh"
3535
args:

.prow/provider-nutanix.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ presubmits:
2828
preset-kubeconfig-ci: "true"
2929
spec:
3030
containers:
31-
- image: quay.io/kubermatic/build:go-1.23-node-20-kind-0.26-10
31+
- image: quay.io/kubermatic/build:go-1.24-node-20-kind-0.27-3
3232
command:
3333
- "./hack/ci/run-e2e-tests.sh"
3434
args:

0 commit comments

Comments
 (0)