Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.7] 🌱 Bump to Go 1.21 #2745

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ set -o nounset
set -o pipefail

# MIN_GO_VERSION is the minimum, supported Go version.
MIN_GO_VERSION="go${MIN_GO_VERSION:-1.20}"
# 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.21}"

# Ensure the go tool exists and is a viable version.
verify_go_version() {
Expand Down
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"errors"
"flag"
"fmt"
"math/rand"
"net/http"
"net/http/pprof"
"os"
Expand Down Expand Up @@ -154,8 +153,6 @@ func InitFlags(fs *pflag.FlagSet) {
}

func main() {
rand.Seed(time.Now().UnixNano())

InitFlags(pflag.CommandLine)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
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
Loading