Skip to content

Commit

Permalink
Bump up golang in github actions
Browse files Browse the repository at this point in the history
And fix resuting linter errors

Signed-off-by: Anna Khmelnitsky <[email protected]>
  • Loading branch information
annakhm committed Sep 25, 2024
1 parent ede0dfe commit 242af05
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
- uses: actions/checkout@v3
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22
- uses: actions/checkout@v4
go-version-file: 'go.mod'
- name: Install dependencies
run: |
go get .
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version-file: 'go.mod'
-
name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
args: --issues-exit-code=1
skip-pkg-cache: true
skip-build-cache: true
-
name: Import GPG key
id: import_gpg
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ linters:
- gosec
- goimports
- vet
- revive
- misspell
- gosimple
- staticcheck
Expand Down
1 change: 1 addition & 0 deletions nsxt/data_source_nsxt_policy_uplink_host_switch_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package nsxt

import (
"fmt"

"github.com/vmware/vsphere-automation-sdk-go/runtime/bindings"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
1 change: 1 addition & 0 deletions nsxt/data_source_nsxt_upgrade_prepare_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package nsxt

import (
"fmt"

"github.com/vmware/terraform-provider-nsxt/nsxt/util"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
5 changes: 5 additions & 0 deletions nsxt/resource_nsxt_upgrade_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func prepareUpgrade(upgradeClientSet *upgradeClientSet, d *schema.ResourceData,
continue
}

//#nosec G601 Ignore implicit memory aliasing in for loop temporarily
status, err := getUpgradeStatus(upgradeClientSet.StatusClient, &component)
if err != nil {
return err
Expand All @@ -407,13 +408,15 @@ func prepareUpgrade(upgradeClientSet *upgradeClientSet, d *schema.ResourceData,
if status.Status == model.ComponentUpgradeStatus_STATUS_IN_PROGRESS {
upgradeClientSet.PlanClient.Pause()
}
//#nosec G601 Ignore implicit memory aliasing in for loop temporarily
err = waitUpgradeForStatus(upgradeClientSet, &component, inFlightComponentUpgradeStatus, staticComponentUpgradeStatus)
if err != nil {
return err
}

// Cache the group list before reset as group IDs change by reset operation. References for some types of groups
// could be affected here
//#nosec G601 Ignore implicit memory aliasing in for loop temporarily
preResetGroupList, err := upgradeClientSet.GroupClient.List(&component, nil, nil, nil, nil, nil, nil, nil)
if err != nil {
return err
Expand Down Expand Up @@ -746,7 +749,9 @@ func runUpgrade(upgradeClientSet *upgradeClientSet, partialUpgradeMap map[string
prevComponent = component
completeLog = fmt.Sprintf("[INFO] %s upgrade is partially completed.", component)
}
//#nosec G601 Ignore implicit memory aliasing in for loop temporarily
upgradeClientSet.PlanClient.Upgrade(&component)
//#nosec G601 Ignore implicit memory aliasing in for loop temporarily
err = waitUpgradeForStatus(upgradeClientSet, &component, pendingStatus, targetStatus)
if err != nil {
return err
Expand Down

0 comments on commit 242af05

Please sign in to comment.