Skip to content

Commit

Permalink
Bump to Go 1.21
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Büringer <buringerst@vmware.com>
  • Loading branch information
sbueringer authored and chrischdi committed Feb 15, 2024
1 parent 466ad83 commit 9a0e52f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # tag=v3.6.0
with:
version: v1.53.3
version: v1.55.2
args: --out-format=colored-line-number
17 changes: 10 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
run:
timeout: 10m
go: "1.21"
skip-files:
- ".*zz_generated.*\\.go"
- "contrib/.*"
- "apis/v1alpha3/.*"
- "apis/v1alpha4/.*"
allow-parallel-runners: true

linters:
disable-all: true
enable:
Expand Down Expand Up @@ -40,13 +50,6 @@ linters:
linters-settings:
gci:
local-prefixes: sigs.k8s.io/cluster-api-provider-vsphere
run:
skip-files:
- ".*zz_generated.*\\.go"
- "contrib/.*"
- "apis/v1alpha3/.*"
- "apis/v1alpha4/.*"
timeout: 5m
issue:
max-same-issues: 0
max-per-linter: 0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SHELL:=/usr/bin/env bash
#
# Go.
#
GO_VERSION ?= 1.20.12
GO_VERSION ?= 1.21.5
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)

# Use GOPROXY environment variable if set
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
# MIN_GO_VERSION is the minimum, supported Go version.
# Note: Enforce only the minor version as we can't guarantee that
# the images we use in ProwJobs already use the latest patch version.
MIN_GO_VERSION="go${MIN_GO_VERSION:-1.20}"
MIN_GO_VERSION="go${MIN_GO_VERSION:-1.21}"

# Ensure the go tool exists and is a viable version.
verify_go_version() {
Expand Down
3 changes: 2 additions & 1 deletion pkg/services/govmomi/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func Test_ShouldRetryTask(t *testing.T) {
{baseTask(types.TaskInfoStateRunning, ""), false},
{baseTask(types.TaskInfoStateSuccess, ""), true},
}
for _, tt := range tests {
for i := range tests {
tt := tests[i]
t.Run(fmt.Sprintf("state: %s", tt.task.Info.State), func(t *testing.T) {
g = NewWithT(t)
reconciled, err := checkAndRetryTask(vmCtx, &tt.task)
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/network/nsxt_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (np *nsxtNetworkProvider) ProvisionClusterNetwork(ctx *vmware.ClusterContex
"cluster", clusterKey, "ip", systemNSSnatIP)

// WhitelistSourceRanges accept cidrs only
vnet.Spec.WhitelistSourceRanges = systemNSSnatIP + "/32"
vnet.Spec.WhitelistSourceRanges = systemNSSnatIP + "/32" //nolint:goconst
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/services/vmoperator/vmopmachine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var _ = Describe("VirtualMachine tests", func() {

// Provide valid bootstrap data.
By("bootstrap data is created")
secretName := machine.GetName() + "-data"
secretName := machine.GetName() + "-data" //nolint:goconst
secret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: secretName,
Expand Down

0 comments on commit 9a0e52f

Please sign in to comment.