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

update golang to v1.20 #3478

Merged
merged 1 commit into from
Apr 28, 2023
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/cover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.20'
- run: "PATH=/usr/local/go/bin:$PATH make test-cover"
- uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-code-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: '1.19'
go-version: '1.20'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3 # tag=v3.2.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install go
uses: actions/setup-go@v4
with:
go-version: '^1.19'
go-version: '^1.20'
- name: generate release artifacts
run: |
make release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: Setup go
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # tag=v3.4.0
with:
go-version: 1.19
go-version: 1.20
- name: Run verify container script
run: make verify-container-images
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ linters-settings:
arguments:
- disableStutteringCheck
staticcheck:
go: "1.19"
go: "1.20"
stylecheck:
go: "1.19"
go: "1.20"
unused:
go: "1.19"
go: "1.20"

issues:
exclude-rules:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ARG ARCH

# Build the manager binary
FROM golang:1.19 as builder
FROM golang:1.20 as builder
WORKDIR /workspace

# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ delete-workload-cluster: $(KUBECTL) ## Deletes the example workload Kubernetes c
.PHONY: docker-pull-prerequisites
docker-pull-prerequisites: ## Pull prerequisites for building controller-manager.
docker pull docker/dockerfile:1.4
docker pull docker.io/library/golang:1.19
docker pull docker.io/library/golang:1.20
docker pull gcr.io/distroless/static:latest

.PHONY: docker-build
Expand Down Expand Up @@ -614,7 +614,7 @@ release-binary: $(RELEASE_DIR) ## Compile and build release binaries.
-e GOARCH=$(GOARCH) \
-v "$$(pwd):/workspace" \
-w /workspace \
golang:1.19 \
golang:1.20 \
go build -a -ldflags '$(LDFLAGS) -extldflags "-static"' \
-o $(RELEASE_DIR)/$(notdir $(RELEASE_BINARY))-$(GOOS)-$(GOARCH) $(RELEASE_BINARY)

Expand Down
2 changes: 1 addition & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def validate_auth():

tilt_helper_dockerfile_header = """
# Tilt image
FROM golang:1.19 as tilt-helper
FROM golang:1.20 as tilt-helper
# Support live reloading with Tilt
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/restart.sh && \
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/windmilleng/rerun-process-wrapper/master/start.sh && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ func orderByOldest(machines []infrav1exp.AzureMachinePoolMachine) []infrav1exp.A
}

func orderRandom(machines []infrav1exp.AzureMachinePoolMachine) []infrav1exp.AzureMachinePoolMachine {
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(machines), func(i, j int) { machines[i], machines[j] = machines[j], machines[i] })
//nolint:gosec // We don't need a cryptographically appropriate random number here
r := rand.New(rand.NewSource(time.Now().UnixNano()))
r.Shuffle(len(machines), func(i, j int) { machines[i], machines[j] = machines[j], machines[i] })
return machines
}

Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/developers/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
### Base requirements

1. Install [go][go]
- Get the latest patch version for go v1.19.
- Get the latest patch version for go v1.20.
2. Install [jq][jq]
- `brew install jq` on macOS.
- `sudo apt install jq` on Windows + WSL2
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 sigs.k8s.io/cluster-api-provider-azure

go 1.19
go 1.20

require (
github.com/Azure/aad-pod-identity v1.8.15
Expand Down
2 changes: 1 addition & 1 deletion hack/ensure-go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ EOF
local go_version
IFS=" " read -ra go_version <<< "$(go version)"
local minimum_go_version
minimum_go_version=go1.19.0
minimum_go_version=go1.20.0
if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then
cat <<EOF
Detected go version: ${go_version[*]}.
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cluster-api-provider-azure/hack/tools

go 1.19
go 1.20

require (
github.com/hashicorp/go-multierror v1.1.1
Expand Down