Skip to content

Commit f766a14

Browse files
chore(deps): bump golangci/golangci-lint-action from 6.5.0 to 9.2.0 (#1363)
* chore(deps): bump golangci/golangci-lint-action from 6.5.0 to 9.2.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.0 to 9.2.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-version: 9.2.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * chore: migrate golangci-lint config --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patryk Małek <[email protected]>
1 parent 517eae3 commit f766a14

File tree

11 files changed

+97
-92
lines changed

11 files changed

+97
-92
lines changed

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ jobs:
3636
go-version-file: go.mod
3737

3838
- name: Run golangci-lint
39-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
39+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
4040
with:
4141
skip-cache: true # actions/setup-go from v4 handles caching for us

.golangci.yaml

Lines changed: 78 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,100 @@
1-
run:
2-
timeout: 5m
1+
version: "2"
32
linters:
43
enable:
54
- asciicheck
65
- bodyclose
6+
- copyloopvar
77
- dogsled
88
- durationcheck
9-
- errcheck
109
- exhaustive
11-
- copyloopvar
1210
- forbidigo
1311
- gochecknoinits
1412
- gocritic
15-
- gofmt
16-
- goimports
1713
- gomodguard
1814
- gosec
19-
- gci
20-
- gosimple
21-
- govet
2215
- importas
23-
- ineffassign
2416
- misspell
2517
- mnd
2618
- nilerr
2719
- nolintlint
2820
- predeclared
2921
- revive
30-
- staticcheck
31-
- typecheck
3222
- unconvert
3323
- unparam
34-
- unused
3524
- wastedassign
36-
37-
linters-settings:
38-
exhaustive:
39-
default-signifies-exhaustive: true
40-
gci:
41-
sections:
42-
- standard
43-
- default
44-
- prefix(github.com/kong/kubernetes-testing-framework)
45-
gomodguard:
46-
blocked:
47-
modules:
48-
- github.com/ghodss/yaml:
49-
recommendations:
50-
- sigs.k8s.io/yaml
51-
- gopkg.in/yaml.v2:
52-
recommendations:
53-
- sigs.k8s.io/yaml
54-
- gopkg.in/yaml.v3:
55-
recommendations:
56-
- sigs.k8s.io/yaml
57-
- github.com/pkg/errors:
58-
recommendations:
59-
- fmt
60-
- errors
61-
- golang.org/x/net/context:
62-
recommendations:
63-
- context
64-
importas:
65-
no-unaliased: true
66-
alias:
67-
- pkg: k8s.io/api/core/v1
68-
alias: corev1
69-
- pkg: k8s.io/api/apps/v1
70-
alias: appsv1
71-
- pkg: k8s.io/api/networking/v1
72-
alias: netv1
73-
- pkg: k8s.io/api/networking/v1beta1
74-
alias: netv1beta1
75-
- pkg: k8s.io/api/discovery/v1
76-
alias: discoveryv1
77-
- pkg: k8s.io/api/extensions/v1beta1
78-
alias: extv1beta1
79-
- pkg: k8s.io/api/rbac/v1
80-
alias: rbacv1
81-
82-
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
83-
alias: metav1
84-
- pkg: sigs.k8s.io/gateway-api/apis/(v[\w\d]+)
85-
alias: gateway${1}
86-
forbidigo:
87-
exclude-godoc-examples: false
88-
forbid:
89-
- 'CoreV1\(\)\.Endpoints(# use DiscoveryV1 EndpointSlices API instead)?'
90-
- 'corev1\.Endpoint(# use DiscoveryV1 EndpointSlices API instead)?'
25+
settings:
26+
exhaustive:
27+
default-signifies-exhaustive: true
28+
forbidigo:
29+
forbid:
30+
- pattern: CoreV1\(\)\.Endpoints(# use DiscoveryV1 EndpointSlices API instead)?
31+
- pattern: corev1\.Endpoint(# use DiscoveryV1 EndpointSlices API instead)?
32+
exclude-godoc-examples: false
33+
gomodguard:
34+
blocked:
35+
modules:
36+
- github.com/ghodss/yaml:
37+
recommendations:
38+
- sigs.k8s.io/yaml
39+
- gopkg.in/yaml.v2:
40+
recommendations:
41+
- sigs.k8s.io/yaml
42+
- gopkg.in/yaml.v3:
43+
recommendations:
44+
- sigs.k8s.io/yaml
45+
- github.com/pkg/errors:
46+
recommendations:
47+
- fmt
48+
- errors
49+
- golang.org/x/net/context:
50+
recommendations:
51+
- context
52+
importas:
53+
alias:
54+
- pkg: k8s.io/api/core/v1
55+
alias: corev1
56+
- pkg: k8s.io/api/apps/v1
57+
alias: appsv1
58+
- pkg: k8s.io/api/networking/v1
59+
alias: netv1
60+
- pkg: k8s.io/api/networking/v1beta1
61+
alias: netv1beta1
62+
- pkg: k8s.io/api/discovery/v1
63+
alias: discoveryv1
64+
- pkg: k8s.io/api/extensions/v1beta1
65+
alias: extv1beta1
66+
- pkg: k8s.io/api/rbac/v1
67+
alias: rbacv1
68+
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
69+
alias: metav1
70+
- pkg: sigs.k8s.io/gateway-api/apis/(v[\w\d]+)
71+
alias: gateway${1}
72+
no-unaliased: true
73+
exclusions:
74+
generated: lax
75+
presets:
76+
- comments
77+
- common-false-positives
78+
- legacy
79+
- std-error-handling
80+
paths:
81+
- third_party$
82+
- builtin$
83+
- examples$
84+
formatters:
85+
enable:
86+
- gci
87+
- gofmt
88+
- goimports
89+
settings:
90+
gci:
91+
sections:
92+
- standard
93+
- default
94+
- prefix(github.com/kong/kubernetes-testing-framework)
95+
exclusions:
96+
generated: lax
97+
paths:
98+
- third_party$
99+
- builtin$
100+
- examples$

internal/utils/namespaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package utils
1+
package utils //nolint:revive
22

33
import (
44
"context"

pkg/clusters/addons/istio/addon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (a *Addon) EnableMeshForNamespace(ctx context.Context, cluster clusters.Clu
8787
if err != nil {
8888
return fmt.Errorf("could not enable mesh for namespace %s: %w", name, err)
8989
}
90-
namespace.ObjectMeta.Labels["istio-injection"] = "enabled"
90+
namespace.Labels["istio-injection"] = "enabled"
9191
_, err = cluster.Client().CoreV1().Namespaces().Update(ctx, namespace, metav1.UpdateOptions{})
9292
if err != nil {
9393
if errors.IsConflict(err) {

pkg/clusters/addons/kong/addon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
323323

324324
// set the service type of the proxy's Kubernetes service
325325
if a.proxyServiceType == corev1.ServiceTypeExternalName {
326-
return fmt.Errorf("Service type ExternalName is not currently supported")
326+
return fmt.Errorf("Service type ExternalName is not currently supported") //nolint:staticcheck
327327
}
328328
a.deployArgs = append(a.deployArgs, "--set", fmt.Sprintf("proxy.type=%s", a.proxyServiceType))
329329
a.deployArgs = append(a.deployArgs, "--set", fmt.Sprintf("udpProxy.type=%s", a.proxyServiceType))

pkg/clusters/addons/kuma/addon.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func EnableMeshForNamespace(ctx context.Context, cluster clusters.Cluster, name
9090
if err != nil {
9191
return fmt.Errorf("could not enable mesh for namespace %s: %w", name, err)
9292
}
93-
namespace.ObjectMeta.Labels["kuma.io/sidecar-injection"] = "enabled"
93+
namespace.Labels["kuma.io/sidecar-injection"] = "enabled"
9494
_, err = cluster.Client().CoreV1().Namespaces().Update(ctx, namespace, metav1.UpdateOptions{})
9595
if err != nil {
9696
if errors.IsConflict(err) {
@@ -264,12 +264,10 @@ spec:
264264
action: Allow`
265265
)
266266

267-
var (
268-
// From Kuma 2.6.0, the default mesh traffic permission is no longer created by default
269-
// and must be created manually if mTLS is enabled.
270-
// https://github.com/kumahq/kuma/blob/2.6.0/UPGRADE.md#default-trafficroute-and-trafficpermission-resources-are-not-created-when-creating-a-new-mesh
271-
installDefaultMeshTrafficPermissionCutoffVersion = semver.MustParse("2.6.0")
272-
)
267+
// From Kuma 2.6.0, the default mesh traffic permission is no longer created by default
268+
// and must be created manually if mTLS is enabled.
269+
// https://github.com/kumahq/kuma/blob/2.6.0/UPGRADE.md#default-trafficroute-and-trafficpermission-resources-are-not-created-when-creating-a-new-mesh
270+
var installDefaultMeshTrafficPermissionCutoffVersion = semver.MustParse("2.6.0")
273271

274272
// enableMTLS attempts to apply a Mesh resource with a basic retry mechanism to deal with delays in the Kuma webhook
275273
// startup

pkg/clusters/addons/metallb/metallb.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"k8s.io/apimachinery/pkg/runtime/schema"
2121
"k8s.io/client-go/dynamic"
2222
"sigs.k8s.io/kustomize/api/types"
23-
kustomize "sigs.k8s.io/kustomize/api/types"
2423
"sigs.k8s.io/kustomize/kyaml/resid"
2524

2625
"github.com/kong/kubernetes-testing-framework/internal/retry"
@@ -339,9 +338,9 @@ const admissionPatch = `
339338
`
340339

341340
func getManifest() (io.Reader, error) {
342-
return kubectl.GetKustomizedManifest(kustomize.Kustomization{
341+
return kubectl.GetKustomizedManifest(types.Kustomization{
343342
Resources: []string{metalManifest},
344-
Patches: []kustomize.Patch{
343+
Patches: []types.Patch{
345344
{
346345
Patch: admissionPatch,
347346
Target: &types.Selector{

pkg/clusters/diagnostics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func DumpDiagnostics(ctx context.Context, c Cluster, meta string, outDir string)
120120
}
121121
defer failedAddonOut.Close()
122122
for failed, reason := range failedAddons {
123-
_, err = failedAddonOut.WriteString(fmt.Sprintf("%s: %v\n", failed, reason))
123+
_, err = fmt.Fprintf(failedAddonOut, "%s: %v\n", failed, reason)
124124
if err != nil {
125125
return err
126126
}

pkg/clusters/types/gke/cluster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func (c *Cluster) DumpDiagnostics(ctx context.Context, meta string) (string, err
268268
}
269269
defer failedPodOut.Close()
270270
for failed, reason := range failedPods {
271-
_, err = failedPodOut.WriteString(fmt.Sprintf("%s: %v\n", failed, reason))
271+
_, err = fmt.Fprintf(failedPodOut, "%s: %v\n", failed, reason)
272272
if err != nil {
273273
return outDir, err
274274
}

pkg/environments/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (b *Builder) Build(ctx context.Context) (env Environment, err error) {
184184
// wait for all deployments to report, and gather up any errors
185185
collectedDeploymentErrorsCount := 0
186186
addonDeploymentErrors := make([]error, 0)
187-
for !(collectedDeploymentErrorsCount == len(b.addons)) {
187+
for collectedDeploymentErrorsCount != len(b.addons) {
188188
if err := <-addonDeploymentErrorQueue; err != nil {
189189
addonDeploymentErrors = append(addonDeploymentErrors, err)
190190
}

0 commit comments

Comments
 (0)