Skip to content

Conversation

tklauser
Copy link
Member

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.

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>
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Feb 25, 2025
@tklauser tklauser requested review from a team as code owners February 25, 2025 12:15
@github-actions github-actions bot added the sig/policy Impacts whether traffic is allowed or denied based on user-defined policies. label Feb 25, 2025
@tklauser
Copy link
Member Author

/test

@tklauser tklauser enabled auto-merge February 26, 2025 07:07
@tklauser tklauser added this pull request to the merge queue Feb 26, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 26, 2025
Merged via the queue into main with commit d9de3e4 Feb 26, 2025
297 of 299 checks passed
@tklauser tklauser deleted the pr/tklauser/go-bump-1.24 branch February 26, 2025 12:39
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>
@pchaigno pchaigno added backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. backport-pending/1.16 The backport for Cilium 1.16.x for this PR is in progress. backport-done/1.17 The backport for Cilium 1.17.x for this PR is done. and removed backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. labels Apr 24, 2025
@julianwiedmann julianwiedmann added backport-done/1.16 The backport for Cilium 1.16.x for this PR is done. and removed backport-pending/1.16 The backport for Cilium 1.16.x for this PR is in progress. labels May 6, 2025
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants