8000 update: bump Go version by milosgajdos · Pull Request #4176 · distribution/distribution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

update: bump Go version #4176

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
merged 3 commits into from
Dec 6, 2023

Conversation

milosgajdos
Copy link
Member
@milosgajdos milosgajdos commented Dec 1, 2023

It'd appear Go 1.20.10 is triggering some scanner alerts due to CVE-2023-45283.

Though these are not critical, it costs us very little effort to bump the runtime one minor version higher.

Go 1.20.11 milestone can be found here.

It'd appear 1.20.10 is triggering some scanner alerts.
Though these are not critical, it costs us very little effort to bump
the runtime one minor version higher.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
@thaJeztah
Copy link
Member

Do we need Windows compatibility in any code? Because the security fix in 1.20.11 had a regression; fix for that should hopefully go out on Tuesday; golang/go#64028 (comment)

@milosgajdos
Copy link
Member Author
milosgajdos commented Dec 1, 2023

Tbh, I dont know if anyone runs registry on Windows but we shouldnt rule that out.

If there is a patch release coming out soon then I reckon it's better to wait. Happy to close this and wait for the patch.

I've opened this on a prompt by some people via Slack whose image scanners are moaning.

@thaJeztah
Copy link
Member

Yeah, same; I've been nudging the Go team for a while now (hey, security fixes are all fun and stuff, but if they introduce a regression...). Both docker an containerd are not able to update Go version because of that which, erm, means a significant part of the industry, and 😡 Go maintainers don't give a 💩 every time.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
@thaJeztah
Copy link
Member

I think it's fine to keep this one open (or in draft) and update once the next patch release arrives (it's another security update, so let's see what that brings this time)

@milosgajdos
Copy link
Member Author

Marking as draft until the new Go patch release is out

@milosgajdos milosgajdos marked this pull request as draft December 1, 2023 08:59
@Jamstah
Copy link
Collaborator
Jamstah commented Dec 1, 2023

I feel like its late enough in the go release cycle now we could just bump to 1.21 as well.

@milosgajdos
Copy link
Member Author

Yeah not a bad shout. However 1.21 patch is also to be released, so let's wait and bump it when it's out

@thaJeztah
Copy link
Member

Agree on moving the default to 1.21 (we can keep 1.20 in the CI test-matrix, and always test "latest" and "latest-1" per Go recommendations)

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
@milosgajdos milosgajdos marked this pull request as ready for review December 6, 2023 10:33
@milosgajdos
Copy link
Member Author

PTAL @thaJeztah @Jamstah

I've bumped the runtime in the docker image to the latest 1.21.X and the rest of the Go runtime things to the latest 1.20.X

@Jamstah
Copy link
Collaborator
Jamstah commented Dec 6, 2023

Why not go 1.21 for the CI tasks?

Approved, but would be happy to bump those too.

@milosgajdos
Copy link
Member Author

Why not go 1.21 for the CI tasks?

So my thinking was: if folks don't have the latest tooling on their machines we should strive to "mirror" CI on their laptops...we already do E2E for both minor versions.

I'm happy to change it if we want to.

@Jamstah
Copy link
Collaborator
Jamstah commented Dec 6, 2023

I think that for Mac/Windows, you install golang separately to the OS, so they can use 1.21 easily.

For linux distributions, it tends to be when the package manager updates it.

Maybe we need a policy for when we bump it? Or, we could define a vscode dev container or something too.

Let use this one to bump to the latest patch for the security issues, and open a new one for 1.21 for go.mod etc.

Copy link
Member
@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@milosgajdos milosgajdos merged commit 04e3bda into distribution:main Dec 6, 2023
@milosgajdos milosgajdos deleted the update-golang-version branch December 6, 2023 10:56
@thaJeztah
Copy link
Member

Let use this one to bump to the latest patch for the security issues, and open a new one for 1.21 for go.mod etc.

Updating the version in go.mod means that the module can no longer be used with older versions of go; go1.20.8 and go1.19.13 patch releases (nice change for a "patch" release! 😞) changed the meaning of the Go version in go.mod from "recommendation" to "strict required"; see containerd/containerd#9378 (comment)

@Jamstah
Copy link
Collaborator
Jamstah commented Dec 6, 2023

I guess that means projects used as libraries need to stay low :/

The go line must be greater than or equal to the go line of all dependencies.

Do we consider ourselves to be a project used as a library? Most of those uses were for reference which is now moved out.

@thaJeztah
Copy link
Member
thaJeztah commented Dec 6, 2023

Well, not just as library; if we test on go1.20, we cannot update go.mod to go1.21 (it will fail to compile)

Also if we add the go1.21 line, we probably also want to add a gotoolchain=local, otherwise Go will automatically download and install any version of Go that's specified (not the version of go that's defined in the Dockerfile or CI)

@milosgajdos
Copy link
Member Author

Updating the version in go.mod means that the module can no longer be used with older versions of go; go1.20.8 and go1.19.13 patch releases (nice change for a "patch" release! 😞) changed the meaning of the Go version in go.mod from "recommendation" to "strict required"; see containerd/containerd#9378 (comment)

This is why I didn't want to bump the go.mod to v1.21 just yet.

I reckon once v1.22 is released next year we can bump the go.mod to v1.21 in step with Go releases as we've discussed in the past.

As for the library point: some projects use some storage driver code from this project, at least zot does https://github.com/project-zot/zot/blob/e3bd9a8fa86fc6674482d6a012a9e638137c2439/go.mod#L14, so giving a definitive answer to "are we a library project" is...complicated 🙃

@ialidzhikov ialidzhikov mentioned this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/go-version Go update vresion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0