opencontainers / opencontainers/runc
consider unifying mountEntry.srcFD and mountEntry.idmapFD approach
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Description
I'm somewhat curious why we use a string for
srcFDand anintforidmapFD. Wondering if we should unify the approach (probably can be done in a follow-up)
Originally posted by @thaJeztah in https://github.com/opencontainers/runc/pull/3717#discussion_r1259736922
One uses a string with the path (/proc/self/fd/<FD>), whereas the other uses the bare FD (int).
We could consider using an int for both, and update mountViaFDs() (which is not exported) to internalize constructing the path if the value is not -1; https://github.com/opencontainers/runc/blob/05669c8aba9bd3ee4cb9935a74dbd96828f65fc7/libcontainer/mount_linux.go#L67-L71
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in libcontainer/mount_linux.go, focusing on mountEntry.srcFD, mountEntry.idmapFD, and the unexported mountViaFDs() referenced in the issue. Trace how each descriptor is passed, then unify their representations and have mountViaFDs() construct the /proc/self/fd path for valid descriptors; done means both fields use the same approach without changing mount behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- operating-systems
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100