-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Update Go version to 1.24 in go.mod and fix resulting issues #37852
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting with Go 1.24 non-constant format strings will be reported as an error by go vet[^1]: pkg/policy/rule.go:374:18: non-constant format string in call to (*github.com/cilium/cilium/pkg/policy.SearchContext).PolicyTrace Fix this by using a "%s" format string to PolicyTrace. [^1]: https://go.dev/doc/go1.24#vet Signed-off-by: Tobias Klauser <tobias@cilium.io>
Starting with Go 1.24 RSA key sizes below 1024 lead to an error being returned by rsa.GenerateKey by default[^1] which makes TestSpireDelegateClient_GetCertificateForIdentity when running it using Go 1.24: --- FAIL: TestSpireDelegateClient_GetCertificateForIdentity (0.00s) certificate_provider_test.go:279: failed to generate leaf key: crypto/rsa: 512-bit keys are insecure (see https://go.dev/pkg/crypto/rsa#hdr-Minimum_key_size) FAIL FAIL github.com/cilium/cilium/pkg/auth/spire 0.006s FAIL Fix this by using an 1024-bit RSA key in the test. [^1]: https://go.dev/doc/go1.24#cryptorsapkgcryptorsa Signed-off-by: Tobias Klauser <tobias@cilium.io>
Bump the Go version to 1.24 so that we can import Go 1.24 packages and use the new features. Signed-off-by: Tobias Klauser <tobias@cilium.io>
bimmlerd
approved these changes
Feb 25, 2025
/test |
mhofstetter
approved these changes
Feb 25, 2025
nathanjsweet
approved these changes
Feb 25, 2025
sayboras
approved these changes
Feb 26, 2025
marseel
approved these changes
Feb 26, 2025
michi-covalent
added a commit
to cilium/cilium-cli
that referenced
this pull request
Feb 28, 2025
- Partially revert commit cc1a61d [^1] since Cilium updated the Go version to 1.24 in main branch [^2]. - Change the default go-mod-directory to the top-level directory to match the current code structure in cilium/cilium where go.mod file is only in the top-level directory. - Set setup-go cache-dependency-path parameter to '**/go.sum' so that caching works regardless of how go-mod-directory parameter is set. [^1]: #2871 [^2]: cilium/cilium#37852 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent
added a commit
to cilium/cilium-cli
that referenced
this pull request
Feb 28, 2025
- Partially revert commit cc1a61d [^1] since Cilium updated the Go version to 1.24 in main branch [^2]. - Change the default go-mod-directory to the top-level directory to match the current code structure in cilium/cilium where go.mod file is only in the top-level directory. - Set setup-go cache-dependency-path parameter to '**/go.sum' so that caching works regardless of how go-mod-directory parameter is set. [^1]: #2871 [^2]: cilium/cilium#37852 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent
added a commit
to cilium/cilium-cli
that referenced
this pull request
Feb 28, 2025
- Partially revert commit cc1a61d [^1] since Cilium updated the Go version to 1.24 in main branch [^2]. - Change the default go-mod-directory to the top-level directory to match the current code structure in cilium/cilium where go.mod file is only in the top-level directory. - Set setup-go cache-dependency-path parameter to '**/go.sum' so that caching works regardless of how go-mod-directory parameter is set. [^1]: #2871 [^2]: cilium/cilium#37852 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
michi-covalent
added a commit
to cilium/cilium-cli
that referenced
this pull request
Feb 28, 2025
- Partially revert commit cc1a61d [^1] since Cilium updated the Go version to 1.24 in main branch [^2]. - Change the default go-mod-directory to the top-level directory to match the current code structure in cilium/cilium where go.mod file is only in the top-level directory. - Set setup-go cache-dependency-path parameter to '**/go.sum' so that caching works regardless of how go-mod-directory parameter is set. [^1]: #2871 [^2]: cilium/cilium#37852 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-done/1.16
The backport for Cilium 1.16.x for this PR is done.
backport-done/1.17
The backport for Cilium 1.17.x for this PR is done.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/misc
This PR makes changes that have no direct user impact.
sig/policy
Impacts whether traffic is allowed or denied based on user-defined policies.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bump the Go version in
go.mod
to 1.24 so that we can import Go 1.24 packages and use new features, e.g.slog.DiscardHandler
.See commits for details.
Split out of #37847 to ease review.