-
Notifications
You must be signed in to change notification settings - Fork 859
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
chore: update go version #6908
chore: update go version #6908
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Okabe-Junya The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
/retest |
I'm sorry for not being able to share the progress. I thought I could resolve this issue quickly, but it might be a bit hard. I tried to update the k/test-infra config to pass the CI, but it pointed to the "latest" tag of the container image. (I thought it could be resolved with a simple update like kubernetes/test-infra#32786, but that doesn’t seem to be the case) To investigate this image, I checked Additionally, since "k8s.gcr.io" is deprecated, it would be better to use "registry.k8s.io" as well. |
I think the simplest approach to update the "latest" of the image would be to set the go version of k/registry.k8s.io to 1.22.4. This would allow us to update the Go version that archeio depends on. Releasing a new archeio would then update the original image. (This is a somewhat hard task.) What I'm not sure about is which image the golang image in k/test-infra's config/jobs/kubernetes/sig-k8s-infra/registry.k8s.io/sig-k8s-infra-registry-presubmits.yaml is referring to. Is it from Docker Hub? - If so, I want to refer specific tag In any case, I think updating the go version of k/registry.k8s.io is a good try (and it would be an easy place to start!). |
FYI: I have written the context See https://kubernetes.slack.com/archives/CCK68P2Q2/p1718816152584299 |
@Okabe-Junya do you think we can directly use a golang image itself for the k8sio-groups-test? It would decouple it from bumping registry.k8s.io which would have a wider impact. |
groups/go.mod
Outdated
@@ -1,6 +1,6 @@ | |||
module k8s.io/k8s.io/groups | |||
|
|||
go 1.17 | |||
go 1.22.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bumping this doesn't necessarily change the version of go being used to compile, this changes the version of go required to build the module (and what go features are enabled / compatibility changes)
are we intending to use newer go features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we intending to use newer Go features?
We might not need to use the new features introduced in Go 1.18 and later such as generics, slog, and some built-in functions and so on ... immediately (of course, there would be some if we look for them).
However, from the perspective of performance and security, I don’t see any reason to oppose updating the software version (unless there are breaking changes - which is not the case with Go).
Is there a clear reason why we shouldn’t update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Of course, I understand that the issues will be mitigated by GOTOOLCHAIN…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, from the perspective of performance and security, I don’t see any reason to oppose updating the software version (unless there are breaking changes - which is not the case with Go).
This isn't a software version bump, this line means the go language version, not the toolchain version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(like the difference between upgrading gcc and going from --std=c99 to --std=c14, this is the latter)
The image should be able to have multiple modules at different versions.
We shouldn't be coupling these. Updating images in this repo should not depend on the go version in registry.k8s.io, which automatically manages it's own go version with .go-version and associated tooling (and probably just GOTOOLCHAIN in the future) |
As BenTheElder mentioned, using GOTOOLCHAIN seems to be the best solution. This would indeed remove dependencies on the Go version of registry.k8s.io. Would specifying it in the following spec solve this issue? (or will that be in the future?) And it looks like gcr.io/k8s-staging-infra-tools/k8s-infra is using Go 1.20.5 internally. Do you think it is reasonable to update this 1.20.5 to 1.21 or later? - The reason, of course, is that we want to use GOTOOLCHAIN. k8s.io/images/k8s-infra/Dockerfile Line 32 in 9f67194
|
friendly cc @BenTheElder @MadhavJivrajani I would like to move this PR forward (or close it if these changes are not needed). In any case, I want to advance this discussion. WDYT? |
I think using gotoolchain is reasonable but it should be set here with the code sources and the version in that spec should just be anything new enough to provide toolchain support setting it in that spec means we're still unable to test PRs that update the go version |
Thank you BenTheElder! Indeed, it seems better to make changes along with the code source, just like the maintenance PR you created. I will reconsider this, thanks |
can we use go version 1.22.5 directly since there is a new CVE:
|
33c7984
to
ce99707
Compare
@Okabe-Junya: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
I've reconsidered this but still couldn't come up with a good solution. Is there a way to solve the problem you mentioned,
(By "go version" here, I mean If we could merge a simple one-line PR that updates this go version, I think this PR could move forward but... |
I have a question for you, @BenTheElder In https://github.com/kubernetes/k8s.io/pull/5490/files, it looks like many dependencies are being bumped at once. If we can merge this PR, wouldn't it also be possible to bump the Of course, I understand that such a PR would (might) affect the entire Kubernetes community. If it's better for a TL or maintainer to handle this, I'd like to ask for your help, thanks |
/cc BenTheElder |
Sorry I was out friday and there's been a lot going on with the CI migration and the k8s release. I'm still not sure what we're trying to solve, are we trying to use go 1.22 language features?
Yes, though I think we should switch to toolchain so that the go version is tested before any container image is built.
That's not necessarily controlled by changing the The Increasing the language version means changing the behavior of the language, something we may not need or desire at the time and also prevents compiling with older versions. If we just want binaries built from a newer version, these are separate changes and we should improve how we manage that. |
I think this is fine, and we can merge it, but I'm not sure it solves any issues, and I'd prefer to not add additional vectors for issues at this moment, versus solving the toolchain management issue. |
I also to understand why we need to do this. Concerns about a |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Thank you, and I apologize for the delayed response. I studied Go version management in more detail and was finally able to understand your intent.
Given Go backward compatibility and toolchain, it seems that updating the go directive is indeed less important; rather, it would be preferable for it to specify the oldest version at which the build is still possible. Thank you for your support. I will close this PR. /close |
@Okabe-Junya: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Change List
Note
Go 1.21 Release Notes