diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 315feb246..b7476bd10 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -17,15 +17,15 @@ jobs: name: linters runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' check-latest: true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint # Switch back to the official action after this bug is fixed: https://github.com/golangci/golangci-lint/issues/3107 run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1 $(go env GOPATH)/bin/golangci-lint run --out-format=github-actions --timeout=15m --verbose unit: strategy: @@ -34,12 +34,12 @@ jobs: runs-on: ${{matrix.os}} name: unit tests ${{ matrix.os }} steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' check-latest: true - - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: # In order: # * Module download cache @@ -84,7 +84,7 @@ jobs: echo "PR_Number=${{ github.event.pull_request.number }}" - if: runner.os != 'Windows' name: Upload the artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: "coverage-report-${{ runner.os }}-${{ github.run_number }}.html" path: ${{ runner.os }}-coverage.html diff --git a/.golangci.yml b/.golangci.yml index 8da65941c..9fb654d79 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,7 +33,7 @@ linters-settings: gofumpt: # Select the Go version to target. # Default: 1.15 - lang-version: "1.21" + lang-version: "1.22" # Choose whether to use the extra rules. # Default: false diff --git a/BUILD.md b/BUILD.md index 1972f4c9d..71c406b25 100644 --- a/BUILD.md +++ b/BUILD.md @@ -32,7 +32,7 @@ Container registry used to tag images and manifests, and optionally to push imag `GO_IMAGE` -Default: `golang:1.21` +Default: `golang:1.22` Container image used by default `$GO_SHELL` to run binary build scripts. diff --git a/Makefile b/Makefile index 11b9ecfa6..dce712419 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ REGISTRY ?= $(DEFAULT_REGISTRY) BUILDX_OUTPUT ?= load # GO_IMAGE golang image used in default GO_SHELL -GO_IMAGE ?= golang:1.21 +GO_IMAGE ?= golang:1.22 # GO_CMD go command used for go build GO_CMD ?= go diff --git a/core/orchestrator_core.go b/core/orchestrator_core.go index 70db51b38..766c5c669 100644 --- a/core/orchestrator_core.go +++ b/core/orchestrator_core.go @@ -4630,7 +4630,6 @@ func (o *TridentOrchestrator) ReloadVolumes(ctx context.Context) (err error) { // Re-run the volume bootstrapping code err = o.bootstrapVolumes(ctx) - // If anything went wrong, reinstate the original volumes if err != nil { Logc(ctx).Errorf("Volume reload failed, restoring original volume list: %v", err) diff --git a/core/orchestrator_core_test.go b/core/orchestrator_core_test.go index 4e1285393..4e0016b32 100644 --- a/core/orchestrator_core_test.go +++ b/core/orchestrator_core_test.go @@ -1699,7 +1699,6 @@ func TestBackendUpdateAndDelete(t *testing.T) { } _, err = orchestrator.UpdateBackend(ctx(), backendName, newConfigJSON, "") - if err != nil { t.Errorf("%s: unable to update backend with a nonconflicting change: %v", c.name, err) continue diff --git a/frontend/crd/trident_mirror_relationship_test.go b/frontend/crd/trident_mirror_relationship_test.go index 7f28580bb..b0e7450af 100644 --- a/frontend/crd/trident_mirror_relationship_test.go +++ b/frontend/crd/trident_mirror_relationship_test.go @@ -154,7 +154,6 @@ func TestUpdateTMRConditionLocalFields(t *testing.T) { statusCondition = &netappv1.TridentMirrorRelationshipCondition{} newStatusCondition, err = updateTMRConditionLocalFields( statusCondition, localPVCName, remoteVolumeHandle) - if err != nil { t.Errorf("Got error updating TMR condition") } diff --git a/go.mod b/go.mod index 21a49ed54..b1a9d0410 100755 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/netapp/trident -go 1.21 +go 1.22 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 diff --git a/operator/controllers/orchestrator/installer/installer.go b/operator/controllers/orchestrator/installer/installer.go index a0701b8fc..168156369 100644 --- a/operator/controllers/orchestrator/installer/installer.go +++ b/operator/controllers/orchestrator/installer/installer.go @@ -1118,7 +1118,6 @@ func (i *Installer) createOrPatchTridentRoleBindings( err = i.client.PutRoleBinding(currentRoleBindingMap[roleBindingName], reuseRoleBindingMap[roleBindingName], newRoleBindingYAML, labelString) - if err != nil { return fmt.Errorf("failed to create or patch Trident role binding; %v", err) } diff --git a/storage_drivers/ontap/ontap_nas.go b/storage_drivers/ontap/ontap_nas.go index 4d5ba8b16..718dfda47 100644 --- a/storage_drivers/ontap/ontap_nas.go +++ b/storage_drivers/ontap/ontap_nas.go @@ -381,7 +381,6 @@ func (d *NASStorageDriver) Create( UnixPermissions: unixPermissions, DPVolume: volConfig.IsMirrorDestination, }) - if err != nil { if api.IsVolumeCreateJobExistsError(err) { return nil diff --git a/storage_drivers/ontap/ontap_nas_flexgroup.go b/storage_drivers/ontap/ontap_nas_flexgroup.go index 1e740ae21..3bf510a60 100644 --- a/storage_drivers/ontap/ontap_nas_flexgroup.go +++ b/storage_drivers/ontap/ontap_nas_flexgroup.go @@ -646,7 +646,6 @@ func (d *NASFlexGroupStorageDriver) Create( UnixPermissions: unixPermissions, DPVolume: volConfig.IsMirrorDestination, }) - if err != nil { errMessage := fmt.Sprintf("ONTAP-NAS-FLEXGROUP pool %s; error creating volume %s: %v", storagePool.Name(), name, err) createErrors = append(createErrors, fmt.Errorf(errMessage)) diff --git a/storage_drivers/ontap/ontap_san.go b/storage_drivers/ontap/ontap_san.go index 005b843df..45fcefa87 100644 --- a/storage_drivers/ontap/ontap_san.go +++ b/storage_drivers/ontap/ontap_san.go @@ -458,7 +458,6 @@ func (d *SANStorageDriver) Create( UUID: "", DPVolume: volConfig.IsMirrorDestination, }) - if err != nil { if !api.IsVolumeCreateJobExistsError(err) { errMessage := fmt.Sprintf( @@ -491,7 +490,6 @@ func (d *SANStorageDriver) Create( SpaceReserved: utils.Ptr(false), SpaceAllocated: utils.Ptr(spaceAllocation), }) - if err != nil { errMessage := fmt.Sprintf( "ONTAP-SAN pool %s/%s; error creating LUN %s: %v", storagePool.Name(), diff --git a/storage_drivers/ontap/ontap_san_economy.go b/storage_drivers/ontap/ontap_san_economy.go index a51e6eb8c..d13c3b2bf 100644 --- a/storage_drivers/ontap/ontap_san_economy.go +++ b/storage_drivers/ontap/ontap_san_economy.go @@ -630,7 +630,6 @@ func (d *SANEconomyStorageDriver) Create( SpaceReserved: utils.Ptr(false), SpaceAllocated: utils.Ptr(spaceAllocation), }) - if err != nil { if api.IsTooManyLunsError(err) { Logc(ctx).WithError(err).Warn("ONTAP limit for LUNs/Flexvol reached; finding a new Flexvol") @@ -1625,7 +1624,6 @@ func (d *SANEconomyStorageDriver) createFlexvolForLUN( UUID: "", DPVolume: false, }) - if err != nil { return "", fmt.Errorf("error creating volume: %v", err) } diff --git a/storage_drivers/ontap/ontap_san_nvme.go b/storage_drivers/ontap/ontap_san_nvme.go index 9ca424a79..94946187b 100644 --- a/storage_drivers/ontap/ontap_san_nvme.go +++ b/storage_drivers/ontap/ontap_san_nvme.go @@ -407,7 +407,6 @@ func (d *NVMeStorageDriver) Create( UUID: "", DPVolume: volConfig.IsMirrorDestination, }) - if err != nil { if api.IsVolumeCreateJobExistsError(err) { // TODO(sphadnis): If it was decided that iSCSI has a bug here, make similar changes for NVMe.