feat: Add namespace isolation support for proxy processes#7
Conversation
Signed-off-by: luke <luke.parkin@arm.com>
Signed-off-by: luke <luke.parkin@arm.com>
Signed-off-by: luke <luke.parkin@arm.com>
2b55e23 to
670e0a4
Compare
Signed-off-by: luke <luke.parkin@arm.com>
646e34d to
7d06bff
Compare
The options here were either to override the EUID in the code, or require the E2E tests to be run one as sudo, and one as not sudo. The latter was chosen as the changes to the code for tests were somewhat heavy. Add sudo test run to the actions. Signed-off-by: luke <luke.parkin@arm.com>
7d06bff to
3736da6
Compare
Signed-off-by: luke <luke.parkin@arm.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements network namespace support by creating proxy processes in the namespace as defined by the bundle specification. The changes enable namespace isolation for containers while maintaining compatibility for non-root execution.
- Adds namespace clone flag mapping and processing logic
- Modifies proxy process creation to accept and use namespace specifications
- Includes comprehensive test coverage for both root and non-root scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/runtime/create.go | Updates proxy process creation call to pass spec parameter |
| internal/proxy/proxy.go | Implements namespace flag processing and clone flags for proxy creation |
| e2e/runtime_test.go | Adds test coverage for namespace inheritance and non-root behavior |
| docs/DEVELOPMENT.md | Documents how to run namespace-specific tests requiring sudo |
| .github/workflows/ci.yml | Adds CI workflow step for root namespace tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
7639d66 to
6b9b19a
Compare
Signed-off-by: luke <luke.parkin@arm.com>
8b55ff5 to
9649e44
Compare
yejseo01
left a comment
There was a problem hiding this comment.
Had a look, and had some refactoring suggestions
Signed-off-by: luke <luke.parkin@arm.com>
cfad15b to
f46b9d3
Compare
Signed-off-by: luke <luke.parkin@arm.com>
b932f40 to
e0838bb
Compare
|
Assuming this one is outdated? |
…ionale Signed-off-by: luke <luke.parkin@arm.com>
Signed-off-by: luke <luke.parkin@arm.com>
What does everyone think about this? Bit messy? @muchzill4 |
|
Also- I'm running golangci-lint on v2.6.0 locally and it's not picking up and linting issues :/ |
I think it's fine. Tweaked the test descriptions a bit: |
Signed-off-by: luke <luke.parkin@arm.com>
Signed-off-by: luke <luke.parkin@arm.com>
8ba28c7 to
913f822
Compare
ccd8a6d to
913f822
Compare
refactor: Reuse `Runnable` abstraction for `sudo`
Signed-off-by: luke <luke.parkin@arm.com>
Signed-off-by: Luke Parkin <65398091+Luke-Parkin@users.noreply.github.com>
Signed-off-by: Bartek Mucha <muchzill4@gmail.com>
This PR resolves the issue where the proxy process was being spawned in the namespace as defined by the OCI bundle.
Namespacing can only be effectively delivered in two ways:
However control groups v2 support is not guaranteed (especially in embedded linux distros). Plus, since our proxy process doesn't actually do anything that would require namespacing, it seems overkill to implement cgroups v2 and v1.
For context, runc rewrites the OCI bundle to ignore and flags that wouldn't be supported in rootless mode, if running in rootless mode.
We have elected to do essentially the same, however instead of rewriting the bundle, if our effective user ID is not root, we just don't change the namespace (so it's created into that of the host.)
What this means for the user, is that if they are running in root; everything works as expected. Their proxy process is namespaced as told to by the engine. If they are in rootless, we ignore the namespacing settings.
Changes
Checklist