-
Notifications
You must be signed in to change notification settings - Fork 42
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
integrate libcontainer/userns into moby/sys/user #140
integrate libcontainer/userns into moby/sys/user #140
Commits on Jul 24, 2024
-
libcontainer/system: move userns utilities to separate package
Moving these utilities to a separate package, so that consumers of this package don't have to pull in the whole "system" package. Looking at uses of these utilities (outside of runc itself); `RunningInUserNS()` is used by [various external consumers][1], so adding a "Deprecated" alias for this. [1]: https://grep.app/search?current=2&q=.RunningInUserNS Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b742432 - Browse repository at this point
Copy the full SHA b742432View commit details -
*: rm redundant linux build tag
For files that end with _linux.go or _linux_test.go, there is no need to specify linux build tag, as it is assumed from the file name. In addition, rename libcontainer/notify_linux_v2.go -> libcontainer/notify_v2_linux.go for the file name to make sense. Signed-off-by: Kir Kolyshkin <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for db243e2 - Browse repository at this point
Copy the full SHA db243e2View commit details -
Go 1.17 introduce this new (and better) way to specify build tags. For more info, see https://golang.org/design/draft-gobuild. As a way to seamlessly switch from old to new build tags, gofmt (and gopls) from go 1.17 adds the new tags along with the old ones. Later, when go < 1.17 is no longer supported, the old build tags can be removed. Now, as I started to use latest gopls (v0.7.1), it adds these tags while I edit. Rather than to randomly add new build tags, I guess it is better to do it once for all files. Mind that previous commits removed some tags that were useless, so this one only touches packages that can at least be built on non-linux. Brought to you by go1.17 fmt ./... Signed-off-by: Kir Kolyshkin <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b19e084 - Browse repository at this point
Copy the full SHA b19e084View commit details -
libcontainer/userns: simplify, and separate from "user" package.
This makes libcontainer/userns self-dependent, largely returning to the original implementation from lxc. The `uiMapInUserNS` is kept as a separate function for unit-testing and fuzzing. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87e38c8 - Browse repository at this point
Copy the full SHA 87e38c8View commit details -
Removed pre-go1.17 build-tags with go fix; go fix -mod=readonly ./... Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bb72464 - Browse repository at this point
Copy the full SHA bb72464View commit details -
libct/userns: change RunningInUserNS to a wrapper instead of an alias
This was a poor decision on my side; ab29593 moved this utility to a separate package, and split the exported function from the implementation (and stubs). Out of convenience, I used an alias for the latter part, but there's two downsides to that; - `RunningInUserNS` being an exported var means that (technically) it can be replaced by other code; perhaps that's a "feature", but not one we intended it to be used for. - `RunningInUserNS` being implemented through a var / alias means it's also documented as such on [pkg.go.dev], which is confusing. This patch changes it to a regular function, acting as a wrapper for the underlying implementations. While at it, also slightly touching up the GoDoc to describe its functionality / behavior. [pkg.go.dev]: https://pkg.go.dev/github.com/opencontainers/[email protected]/libcontainer/userns#RunningInUserNS Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 333fe31 - Browse repository at this point
Copy the full SHA 333fe31View commit details -
libct/userns: make fuzzer Linux-only, and remove stub for uidMapInUserNS
The fuzzer for this only runs on Linux; rename the file to be Linux-only so that we don't have to stub out the uidMapInUserNS function. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bc0de32 - Browse repository at this point
Copy the full SHA bc0de32View commit details -
libct/userns: implement RunningInUserNS with sync.OnceValue
Now that we dropped support for go < 1.21, we can use this; moving the sync.once out of the runningInUserNS() implementation would also allow for it to be more easily tested if we'd decide to. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bc3a8a5 - Browse repository at this point
Copy the full SHA bc3a8a5View commit details -
user/userns: add godoc for package
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a40602b - Browse repository at this point
Copy the full SHA a40602bView commit details -
user: require go1.21 or higher
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1Configuration menu - View commit details
-
Copy full SHA for 5cd502c - Browse repository at this point
Copy the full SHA 5cd502cView commit details