Skip to content

Commit

Permalink
upgrading Golang to v1.22
Browse files Browse the repository at this point in the history
Upgrading Golang to v1.22
  • Loading branch information
agagan authored May 21, 2024
1 parent b28c32e commit 190c712
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion core/orchestrator_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion core/orchestrator_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion frontend/crd/trident_mirror_relationship_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion operator/controllers/orchestrator/installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion storage_drivers/ontap/ontap_nas.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func (d *NASStorageDriver) Create(
UnixPermissions: unixPermissions,
DPVolume: volConfig.IsMirrorDestination,
})

if err != nil {
if api.IsVolumeCreateJobExistsError(err) {
return nil
Expand Down
1 change: 0 additions & 1 deletion storage_drivers/ontap/ontap_nas_flexgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions storage_drivers/ontap/ontap_san.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ func (d *SANStorageDriver) Create(
UUID: "",
DPVolume: volConfig.IsMirrorDestination,
})

if err != nil {
if !api.IsVolumeCreateJobExistsError(err) {
errMessage := fmt.Sprintf(
Expand Down Expand Up @@ -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(),
Expand Down
2 changes: 0 additions & 2 deletions storage_drivers/ontap/ontap_san_economy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -1625,7 +1624,6 @@ func (d *SANEconomyStorageDriver) createFlexvolForLUN(
UUID: "",
DPVolume: false,
})

if err != nil {
return "", fmt.Errorf("error creating volume: %v", err)
}
Expand Down
1 change: 0 additions & 1 deletion storage_drivers/ontap/ontap_san_nvme.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 190c712

Please sign in to comment.