From e4536bfc792a7d8e2320987f714221e0fc26f50d Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:14:28 +0000 Subject: [PATCH 1/5] chore: use go1.24 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bdf53aed8..1e187560f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubernetes-csi/csi-driver-nfs -go 1.23.1 +go 1.24 require ( github.com/container-storage-interface/spec v1.11.0 From 213d951fe3fb8ac022c36083bb29a5d9bdc51b3f Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:15:08 +0000 Subject: [PATCH 2/5] test: use golint v1.64 --- .github/workflows/static.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index db93a0562..3820f71b3 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -15,7 +15,7 @@ jobs: - name: Run linter uses: golangci/golangci-lint-action@v6 with: - version: v1.60 + version: v1.64 args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s verify-helm: name: Verify Helm From 4e39d5fe00fe920157393bd47ae1970034ed89cb Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:15:29 +0000 Subject: [PATCH 3/5] Squashed 'release-tools/' changes from 90efb2ca..701dc34b 701dc34b Merge pull request #273 from andyzhangx/patch-4 aeebd30e Bump golang to 1.24.0 f277d561 Merge pull request #270 from carlory/update-kind-version 6dcb96a5 update default kind version to v0.25.0 git-subtree-dir: release-tools git-subtree-split: 701dc34bc0c28e007eef01d773afecec50f22e8d --- prow.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/prow.sh b/prow.sh index f73e655b3..71b47742c 100755 --- a/prow.sh +++ b/prow.sh @@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp # which is disabled with GOFLAGS=-mod=vendor). configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory" -configvar CSI_PROW_GO_VERSION_BUILD "1.23.6" "Go version for building the component" # depends on component's source code +configvar CSI_PROW_GO_VERSION_BUILD "1.24.0" "Go version for building the component" # depends on component's source code configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below @@ -144,7 +144,7 @@ kind_version_default () { latest|master) echo main;; *) - echo v0.14.0;; + echo v0.25.0;; esac } @@ -155,13 +155,13 @@ configvar CSI_PROW_KIND_VERSION "$(kind_version_default)" "kind" # kind images to use. Must match the kind version. # The release notes of each kind release list the supported images. -configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e -kindest/node:v1.23.6@sha256:b1fa224cc6c7ff32455e0b1fd9cbfd3d3bc87ecaa8fcb06961ed1afb3db0f9ae -kindest/node:v1.22.9@sha256:8135260b959dfe320206eb36b3aeda9cffcb262f4b44cda6b33f7bb73f453105 -kindest/node:v1.21.12@sha256:f316b33dd88f8196379f38feb80545ef3ed44d9197dca1bfd48bcb1583210207 -kindest/node:v1.20.15@sha256:6f2d011dffe182bad80b85f6c00e8ca9d86b5b8922cdf433d53575c4c5212248 -kindest/node:v1.19.16@sha256:d9c819e8668de8d5030708e484a9fdff44d95ec4675d136ef0a0a584e587f65c -kindest/node:v1.18.20@sha256:738cdc23ed4be6cc0b7ea277a2ebcc454c8373d7d8fb991a7fcdbd126188e6d7" "kind images" +configvar CSI_PROW_KIND_IMAGES "kindest/node:v1.32.0@sha256:2458b423d635d7b01637cac2d6de7e1c1dca1148a2ba2e90975e214ca849e7cb +kindest/node:v1.31.2@sha256:18fbefc20a7113353c7b75b5c869d7145a6abd6269154825872dc59c1329912e +kindest/node:v1.30.6@sha256:b6d08db72079ba5ae1f4a88a09025c0a904af3b52387643c285442afb05ab994 +kindest/node:v1.29.10@sha256:3b2d8c31753e6c8069d4fc4517264cd20e86fd36220671fb7d0a5855103aa84b +kindest/node:v1.28.15@sha256:a7c05c7ae043a0b8c818f5a06188bc2c4098f6cb59ca7d1856df00375d839251 +kindest/node:v1.27.16@sha256:2d21a61643eafc439905e18705b8186f3296384750a835ad7a005dceb9546d20 +kindest/node:v1.26.15@sha256:c79602a44b4056d7e48dc20f7504350f1e87530fe953428b792def00bc1076dd" "kind images" # By default, this script tests sidecars with the CSI hostpath driver, # using the install_csi_driver function. That function depends on From 32d5efcf7e3a37743350b12eb893c8a55641e3c7 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:23:29 +0000 Subject: [PATCH 4/5] chore: fix golint errors --- pkg/nfs/controllerserver.go | 2 +- pkg/nfs/utils.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/nfs/controllerserver.go b/pkg/nfs/controllerserver.go index ff1a91673..db34c3402 100644 --- a/pkg/nfs/controllerserver.go +++ b/pkg/nfs/controllerserver.go @@ -800,7 +800,7 @@ func getNfsVolFromID(id string) (*nfsVolume, error) { // try with separator "/" volRegex := regexp.MustCompile("^([^/]+)/(.*)/([^/]+)$") tokens := volRegex.FindStringSubmatch(id) - if tokens == nil || len(tokens) < 4 { + if len(tokens) < 4 { return nil, fmt.Errorf("could not split %s into server, baseDir and subDir with separator(%s)", id, "/") } server = tokens[1] diff --git a/pkg/nfs/utils.go b/pkg/nfs/utils.go index 53737cb26..6b59a2342 100644 --- a/pkg/nfs/utils.go +++ b/pkg/nfs/utils.go @@ -67,21 +67,21 @@ func NewControllerServer(d *Driver) *ControllerServer { } } -func NewControllerServiceCapability(cap csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability { +func NewControllerServiceCapability(c csi.ControllerServiceCapability_RPC_Type) *csi.ControllerServiceCapability { return &csi.ControllerServiceCapability{ Type: &csi.ControllerServiceCapability_Rpc{ Rpc: &csi.ControllerServiceCapability_RPC{ - Type: cap, + Type: c, }, }, } } -func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability { +func NewNodeServiceCapability(c csi.NodeServiceCapability_RPC_Type) *csi.NodeServiceCapability { return &csi.NodeServiceCapability{ Type: &csi.NodeServiceCapability_Rpc{ Rpc: &csi.NodeServiceCapability_RPC{ - Type: cap, + Type: c, }, }, } From 4213be64bce0d73503c4ce0883e2adf7e0da4294 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 2 Apr 2025 09:27:04 +0000 Subject: [PATCH 5/5] test: use copyloopvar golint rule fix golint fix --- .github/workflows/static.yaml | 2 +- pkg/nfs/controllerserver_test.go | 4 ---- pkg/nfs/utils_test.go | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 3820f71b3..98150a436 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -16,7 +16,7 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: v1.64 - args: -E=gofmt,unused,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,contextcheck --timeout=30m0s + args: -E=gofmt,unused,ineffassign,revive,misspell,copyloopvar,asciicheck,bodyclose,contextcheck --timeout=30m0s verify-helm: name: Verify Helm runs-on: ubuntu-latest diff --git a/pkg/nfs/controllerserver_test.go b/pkg/nfs/controllerserver_test.go index 540292ee7..0fd4e046c 100644 --- a/pkg/nfs/controllerserver_test.go +++ b/pkg/nfs/controllerserver_test.go @@ -218,7 +218,6 @@ func TestCreateVolume(t *testing.T) { } for _, test := range cases { - test := test //pin t.Run(test.name, func(t *testing.T) { // Setup cs := initTestController(t) @@ -300,7 +299,6 @@ func TestDeleteVolume(t *testing.T) { } for _, test := range cases { - test := test //pin if runtime.GOOS == "windows" && !test.testOnWindows { continue } @@ -386,7 +384,6 @@ func TestControllerGetCapabilities(t *testing.T) { } for _, test := range cases { - test := test //pin t.Run(test.desc, func(t *testing.T) { // Setup cs := initTestController(t) @@ -526,7 +523,6 @@ func TestNfsVolFromId(t *testing.T) { } for _, test := range cases { - test := test //pin t.Run(test.name, func(t *testing.T) { resp, err := getNfsVolFromID(test.volumeID) diff --git a/pkg/nfs/utils_test.go b/pkg/nfs/utils_test.go index 58a457ff9..08dde0e9b 100644 --- a/pkg/nfs/utils_test.go +++ b/pkg/nfs/utils_test.go @@ -65,7 +65,6 @@ func TestParseEndpoint(t *testing.T) { } for _, test := range cases { - test := test //pin t.Run(test.desc, func(t *testing.T) { proto, addr, err := ParseEndpoint(test.endpoint)