-
Notifications
You must be signed in to change notification settings - Fork 3.6k
chore: remove go version specific code #11857
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
base: main
Are you sure you want to change the base?
chore: remove go version specific code #11857
Conversation
Skipping CI for Draft Pull Request. |
dbc19ad
to
f194d8c
Compare
/cc @fuweid @thaJeztah since you guys contributed some of these code and may have more context on them. I think we should be good to delete them given we have go 1.24.3 as the min 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.
Pull Request Overview
This PR removes Go version–specific workarounds now that Go 1.24 is the minimum supported version, consolidates duplicate logic, and cleans up legacy test files.
- Drop the Go 1.23 “double close” PIDFD workaround and its
runtime
import inunshare_linux.go
. - Standardize on
fs.FileInfoToDirEntry
and remove Go 1.16/1.17 compatibility tests. - Simplify the mount package’s
getUsernsFD
by removing legacy build tags and updating PIDFD logic.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pkg/sys/unshare_linux.go | Removed runtime import and Go 1.23 PIDFD dup-close logic |
pkg/oci/utils_unix_test.go | Replaced custom fileInfoToDirEntry with fs.FileInfoToDirEntry |
pkg/oci/utils_unix_go117_test.go | Deleted Go 1.17–specific compatibility shim |
pkg/oci/utils_unix_go116_test.go | Deleted Go 1.16–specific compatibility shim |
core/mount/mount_idmapped_utils_linux_go122.go | Deleted Go 1.22–specific mount helpers |
core/mount/mount_idmapped_utils_linux.go | Updated getUsernsFD to always use PIDFD, removed outdated checks |
hmm this issue shows up again |
Now that we have 1.24.x as go min version, I think we can remove this go code specific to a lower version. Signed-off-by: Jin Dong <djdongjin95@gmail.com>
f194d8c
to
734d52c
Compare
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.
LGTM
indeed, as the module no longer allows older Go versions, this will just be dead code.
Now that we have 1.24.x as go min version, I think we can remove this go code specific to a lower
version.
Depends on