Skip to content

Commit 33f99a9

Browse files
committed
fix: bumps golangci-lint to work with go 1.24+
1 parent ea774f5 commit 33f99a9

File tree

10 files changed

+15
-13
lines changed

10 files changed

+15
-13
lines changed

.github/workflows/pr-golangci-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: golangci-lint
2929
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47 # tag=v9.0.0
3030
with:
31-
version: v2.1.0
31+
version: v2.4.0
3232
working-directory: ${{matrix.working-directory}}
3333
- name: Lint API
3434
run: make lint-api

cmd/clusterawsadm/cmd/ami/common/encryptedcopy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package common
17+
package common //nolint:revive
1818

1919
import (
2020
"fmt"

cmd/clusterawsadm/cmd/util/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
// Package util provides utility functions.
18-
package util
18+
package util //nolint:revive
1919

2020
import (
2121
"fmt"

exp/utils/rosa_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
// Package utils provide helper functions.
18-
package utils
18+
package utils //nolint:revive
1919

2020
import (
2121
"time"

pkg/cloud/services/common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
// Package common defines service contracts used by other services.
18-
package common
18+
package common //nolint:revive
1919

2020
import (
2121
"context"

pkg/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Package utils has the common functions that can be used for cluster-api-provider-aws repo.
2-
package utils
2+
package utils //nolint:revive
33

44
import (
55
"context"

test/e2e/shared/aws.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ func ensureTestImageUploaded(ctx context.Context, e2eCtx *E2EContext) error {
764764
return err
765765
}
766766

767-
cmd := exec.Command("docker", "inspect", "--format='{{index .Id}}'", "gcr.io/k8s-staging-cluster-api/capa-manager:e2e")
767+
cmd := exec.CommandContext(ctx, "docker", "inspect", "--format='{{index .Id}}'", "gcr.io/k8s-staging-cluster-api/capa-manager:e2e")
768768
var stdOut bytes.Buffer
769769
cmd.Stdout = &stdOut
770770
err := cmd.Run()
@@ -775,7 +775,7 @@ func ensureTestImageUploaded(ctx context.Context, e2eCtx *E2EContext) error {
775775
imageSha := strings.ReplaceAll(strings.TrimSuffix(stdOut.String(), "\n"), "'", "")
776776

777777
ecrImageName := repoName + ":e2e"
778-
cmd = exec.Command("docker", "tag", imageSha, ecrImageName) //nolint:gosec
778+
cmd = exec.CommandContext(ctx, "docker", "tag", imageSha, ecrImageName) //nolint:gosec
779779
err = cmd.Run()
780780
if err != nil {
781781
return err
@@ -794,13 +794,13 @@ func ensureTestImageUploaded(ctx context.Context, e2eCtx *E2EContext) error {
794794
return errors.New("failed to decode ECR authentication token")
795795
}
796796

797-
cmd = exec.Command("docker", "login", "--username", strList[0], "--password", strList[1], "public.ecr.aws") //nolint:gosec
797+
cmd = exec.CommandContext(ctx, "docker", "login", "--username", strList[0], "--password", strList[1], "public.ecr.aws") //nolint:gosec
798798
err = cmd.Run()
799799
if err != nil {
800800
return err
801801
}
802802

803-
cmd = exec.Command("docker", "push", ecrImageName)
803+
cmd = exec.CommandContext(ctx, "docker", "push", ecrImageName)
804804
err = cmd.Run()
805805
if err != nil {
806806
return err

test/e2e/shared/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte {
8989
templateDir := path.Join(e2eCtx.Settings.ArtifactFolder, "templates")
9090
newTemplatePath := templateDir + "/" + ciTemplateForUpgradeName
9191

92-
err = exec.Command("cp", ciTemplateForUpgradePath, newTemplatePath).Run() //nolint:gosec
92+
err = exec.CommandContext(context.TODO(), "cp", ciTemplateForUpgradePath, newTemplatePath).Run() //nolint:gosec
9393
Expect(err).NotTo(HaveOccurred())
9494

9595
clusterctlCITemplateForUpgrade := clusterctl.Files{

test/helpers/envtest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ func (t *TestEnvironment) WaitForWebhooks() {
271271
timeout := 1 * time.Second
272272
for {
273273
time.Sleep(1 * time.Second)
274-
conn, err := net.DialTimeout("tcp", net.JoinHostPort("127.0.0.1", strconv.Itoa(port)), timeout)
274+
dialer := &net.Dialer{Timeout: timeout}
275+
conn, err := dialer.DialContext(context.Background(), "tcp", net.JoinHostPort("127.0.0.1", strconv.Itoa(port)))
275276
if err != nil {
276277
klog.V(2).Infof("Webhook port is not ready, will retry in %v: %s", timeout, err)
277278
continue

test/helpers/kubernetesversions/template.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package kubernetesversions
2222

2323
import (
2424
"bytes"
25+
"context"
2526
_ "embed"
2627
"errors"
2728
"fmt"
@@ -128,7 +129,7 @@ func GenerateCIArtifactsInjectedTemplateForDebian(input GenerateCIArtifactsInjec
128129
if err := os.WriteFile(path.Join(overlayDir, "platform-kustomization.yaml"), input.PlatformKustomization, 0o600); err != nil {
129130
return "", err
130131
}
131-
cmd := exec.Command("kustomize", "build", overlayDir) //nolint:gosec // We don't care about command injection here.
132+
cmd := exec.CommandContext(context.TODO(), "kustomize", "build", overlayDir) //nolint:gosec // We don't care about command injection here.
132133
data, err := cmd.CombinedOutput()
133134
if err != nil {
134135
return "", err

0 commit comments

Comments
 (0)