From 173f70479673f9880464f5a5d52e443beddd09e9 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 28 Mar 2024 21:08:02 +0000 Subject: [PATCH] golangci-lint(noctx): fix test files Signed-off-by: Matthieu MOREL --- .golangci.yaml | 1 - test/util/velero/velero_utils.go | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index 3f7e0c11f..5b36f33dd 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -359,7 +359,6 @@ issues: - gosec - gosimple - nilerr - - noctx - staticcheck - stylecheck - unconvert diff --git a/test/util/velero/velero_utils.go b/test/util/velero/velero_utils.go index d90ddab79..b7c6abfff 100644 --- a/test/util/velero/velero_utils.go +++ b/test/util/velero/velero_utils.go @@ -907,7 +907,9 @@ func getVeleroCliTarball(cliTarballUrl string) (*os.File, error) { lastInd := strings.LastIndex(cliTarballUrl, "/") tarball := cliTarballUrl[lastInd+1:] - resp, err := http.Get(cliTarballUrl) + cli := &http.Client{} + req, _ := http.NewRequestWithContext(context.Background(), http.MethodGet, cliTarballUrl, nil) + resp, err := cli.Do(req) if err != nil { return nil, errors.WithMessagef(err, "failed to access Velero CLI tarball") }