Skip to content

Commit aa19542

Browse files
committed
Prevent Unnecessary Version Bumps in go.mod During Go Version Updates
This PR addresses issue kubernetes#20770, where the minikube automation (triggered by make `update-golang-version`) unnecessarily bumped minor or patch versions in `go.mod` when updating the Go version. Following Kubernetes' practice, which avoids such bumps in `go.mod`, this change ensures only the go directive is updated to the stable Go version. **Changes:** - Added `go.mod` to the schema map in `hack/update/golang_version/update_golang_version.go` with a regex (go 1\.\d+\.\d+) to update the go directive to {{.StableVersion}} (e.g., go 1.24.2). - This ensures the automation updates only the go directive without modifying module dependencies, aligning with Kubernetes' `go.mod` behavior. **Impact:** - Running make `update-golang-version` now updates the go directive (e.g., from go 1.22.3 to go 1.24.2) without unintended dependency version bumps. - Tested by setting go 1.22.3 in go.mod, running go mod tidy and make update-golang-version, and verifying only the go directive and toolchain changed. fixes: kubernetes#20773
1 parent 24093a2 commit aa19542

File tree

67 files changed

+72
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+72
-68
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "!deploy/iso/**"
1313
env:
1414
GOPROXY: https://proxy.golang.org
15-
GO_VERSION: '1.24.0'
15+
GO_VERSION: '1.24.2'
1616
permissions:
1717
contents: read
1818

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.24.0'
9+
GO_VERSION: '1.24.2'
1010
permissions:
1111
contents: read
1212

.github/workflows/functional_verified.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
- deleted
2323
env:
2424
GOPROXY: https://proxy.golang.org
25-
GO_VERSION: '1.24.0'
25+
GO_VERSION: '1.24.2'
2626

2727
permissions:
2828
contents: read

.github/workflows/leaderboard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*-beta.*'
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.24.0'
9+
GO_VERSION: '1.24.2'
1010
permissions:
1111
contents: read
1212

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- "!deploy/iso/**"
1515
env:
1616
GOPROXY: https://proxy.golang.org
17-
GO_VERSION: '1.24.0'
17+
GO_VERSION: '1.24.2'
1818
permissions:
1919
contents: read
2020

.github/workflows/minikube-image-benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 2,14 * * *"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.24.0'
9+
GO_VERSION: '1.24.2'
1010
permissions:
1111
contents: read
1212

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "!deploy/iso/**"
1313
env:
1414
GOPROXY: https://proxy.golang.org
15-
GO_VERSION: '1.24.0'
15+
GO_VERSION: '1.24.2'
1616
permissions:
1717
contents: read
1818

.github/workflows/sync-minikube.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 2,14 * * *"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.24.0'
9+
GO_VERSION: '1.24.2'
1010
permissions:
1111
contents: read
1212

.github/workflows/time-to-k8s-public-chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- cron: "0 2,14 * * *"
77
env:
88
GOPROXY: https://proxy.golang.org
9-
GO_VERSION: '1.24.0'
9+
GO_VERSION: '1.24.2'
1010
permissions:
1111
contents: read
1212

.github/workflows/time-to-k8s.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [released]
66
env:
77
GOPROXY: https://proxy.golang.org
8-
GO_VERSION: '1.24.0'
8+
GO_VERSION: '1.24.2'
99
permissions:
1010
contents: read
1111

0 commit comments

Comments
 (0)