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

[go] Bump images, dependencies and versions to go 1.24.0 #129688

Merged
merged 5 commits into from
Feb 27, 2025
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 .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.6
1.24.0
2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.33.0-go1.23.6-bullseye.0
v1.33.0-go1.24.0-bullseye.0
4 changes: 2 additions & 2 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ readonly KUBE_RSYNC_PORT="${KUBE_RSYNC_PORT:-}"
readonly KUBE_CONTAINER_RSYNC_PORT=8730

# These are the default versions (image tags) for their respective base images.
readonly __default_distroless_iptables_version=v0.6.8
readonly __default_go_runner_version=v2.4.0-go1.23.6-bookworm.0
readonly __default_distroless_iptables_version=v0.7.3
readonly __default_go_runner_version=v2.4.0-go1.24.0-bookworm.0
readonly __default_setcap_version=bookworm-v1.0.4

# These are the base images for the Docker-wrapped binaries.
Expand Down
11 changes: 6 additions & 5 deletions build/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies:

# Golang
- name: "golang: upstream version"
version: 1.23.6
version: 1.24.0
refPaths:
- path: .go-version
- path: build/build-image/cross/VERSION
Expand All @@ -130,8 +130,9 @@ dependencies:
#
# This entry is a stub of the major version to allow dependency checks to
# pass when building Kubernetes using a pre-release of Golang.

- name: "golang: 1.<major>"
version: 1.23
version: 1.24
refPaths:
- path: build/build-image/cross/VERSION
- path: hack/lib/golang.sh
Expand All @@ -140,7 +141,7 @@ dependencies:
match: golang:([0-9]+\.[0-9]+).0-bullseye

- name: "registry.k8s.io/kube-cross: dependents"
version: v1.33.0-go1.23.6-bullseye.0
version: v1.33.0-go1.24.0-bullseye.0
refPaths:
- path: build/build-image/cross/VERSION

Expand Down Expand Up @@ -178,15 +179,15 @@ dependencies:
match: registry\.k8s\.io\/build-image\/debian-base:[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)

- name: "registry.k8s.io/distroless-iptables: dependents"
version: v0.6.8
version: v0.7.3
refPaths:
- path: build/common.sh
match: __default_distroless_iptables_version=
- path: test/utils/image/manifest.go
match: configs\[DistrolessIptables\] = Config{list\.BuildImageRegistry, "distroless-iptables", "v([0-9]+)\.([0-9]+)\.([0-9]+)"}

- name: "registry.k8s.io/go-runner: dependents"
version: v2.4.0-go1.23.6-bookworm.0
version: v2.4.0-go1.24.0-bookworm.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

module k8s.io/kubernetes

go 1.23.0
go 1.24.0

godebug default=go1.23
godebug default=go1.24

require (
bitbucket.org/bertimus9/systemstat v0.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.work
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This is a generated file. Do not edit directly.

go 1.23.0
go 1.24.0

godebug default=go1.23
godebug default=go1.24

use (
.
Expand Down
5 changes: 3 additions & 2 deletions hack/golangci-hints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

run:
timeout: 30m
skip-files:
- "^zz_generated.*"

output:
sort-results: true
Expand All @@ -31,6 +29,9 @@ issues:
# staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
- ineffective break statement. Did you mean to break out of the outer loop

exclude-files:
- "^zz_generated.*"

# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassign linter for generated files for conversion
Expand Down
23 changes: 21 additions & 2 deletions hack/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

run:
timeout: 30m
skip-files:
- "^zz_generated.*"

output:
sort-results: true
Expand All @@ -31,6 +29,9 @@ issues:
# staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
- ineffective break statement. Did you mean to break out of the outer loop

exclude-files:
- "^zz_generated.*"

# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassign linter for generated files for conversion
Expand Down Expand Up @@ -72,6 +73,24 @@ issues:
- ginkgolinter
text: use a function call in (Eventually|Consistently)

# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).

- linters:
- govet
text: "lostcancel|printf"

- linters:
- ginkgolinter
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"

- linters:
- testifylint
text: "encoded-compare|error-nil|formatter"

- linters:
- gocritic
text: "append result not assigned to the same slice|put a space between `//` and comment text|sloppyLen|elseif|should rewrite switch statement to if statement|regexpMust|wrapperFunc: use strings.ReplaceAll|singleCaseSwitch|deprecatedComment|exitAfterDefer|captLocal|unlambda|underef|unslice|valSwap|typeSwitchVar"

# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
- linters:
- gocritic
Expand Down
26 changes: 24 additions & 2 deletions hack/golangci.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

run:
timeout: 30m
skip-files:
- "^zz_generated.*"

output:
sort-results: true
Expand All @@ -31,6 +29,9 @@ issues:
# staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
- ineffective break statement. Did you mean to break out of the outer loop

exclude-files:
- "^zz_generated.*"

# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassign linter for generated files for conversion
Expand Down Expand Up @@ -75,6 +76,27 @@ issues:
- ginkgolinter
text: use a function call in (Eventually|Consistently)

{{- if .Base}}

# Some of these seem legitimate, maybe better fix code (https://github.com/kubernetes/kubernetes/issues/130449).

- linters:
- govet
text: "lostcancel|printf"

- linters:
- ginkgolinter
text: "wrong error assertion. Consider using `gomega.(Eventually|Consistently)|wrong comparison assertion|wrong length assertion"

- linters:
- testifylint
text: "encoded-compare|error-nil|formatter"

- linters:
- gocritic
text: "append result not assigned to the same slice|put a space between `//` and comment text|sloppyLen|elseif|should rewrite switch statement to if statement|regexpMust|wrapperFunc: use strings.ReplaceAll|singleCaseSwitch|deprecatedComment|exitAfterDefer|captLocal|unlambda|underef|unslice|valSwap|typeSwitchVar"
{{- end}}

# https://github.com/kubernetes/kubernetes/issues/117288#issuecomment-1507012435
- linters:
- gocritic
Expand Down
4 changes: 2 additions & 2 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ kube::golang::set_platform_envs() {

# if CC is defined for platform then always enable it
ccenv=$(echo "$platform" | awk -F/ '{print "KUBE_" toupper($1) "_" toupper($2) "_CC"}')
if [ -n "${!ccenv-}" ]; then
if [ -n "${!ccenv-}" ]; then
export CGO_ENABLED=1
export CC="${!ccenv}"
fi
Expand Down Expand Up @@ -551,7 +551,7 @@ EOF
local go_version
IFS=" " read -ra go_version <<< "$(GOFLAGS='' go version)"
local minimum_go_version
minimum_go_version=go1.23
minimum_go_version=go1.24
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
kube::log::usage_from_stdin <<EOF
Detected go version: ${go_version[*]}.
Expand Down
Loading