-
Notifications
You must be signed in to change notification settings - Fork 355
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
Support setting no_pivot_root for create and run command #2597
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Vanient <[email protected]>
@Vanient Thanks for your first contribution 🙏 May I ask you to write the description in PR. This is the example template for you: ## What this PR does / why we need it:
## Which issue(s) this PR fixes:
|
ok I have updated the description~ |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2597 +/- ##
==========================================
- Coverage 65.88% 65.86% -0.03%
==========================================
Files 133 133
Lines 16819 16829 +10
==========================================
+ Hits 11081 11084 +3
- Misses 5738 5745 +7 |
Hey, would it be possible to add tests for this flag? |
I thinked about to add tests for this but found a little difficult to add in any file, do you have any good idea... |
@Vanient, I appreciate you giving it a try 🙏 This doc may help you. |
Hey @Vanient , let me know if you need any help in adding the tests here! |
@Vanient , are you still working on this? If you are busy with something else, and cannot work on this, that is fine, just let us know so we can work accordingly. Thanks :) |
@@ -41,4 +41,6 @@ pub struct ContainerArgs { | |||
pub detached: bool, | |||
/// Manage the functions that actually run on the container | |||
pub executor: Box<dyn Executor>, | |||
/// If do not use pivot root to jail process inside rootfs |
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.
/// If do not use pivot root to jail process inside rootfs | |
/// If do not use pivot root to container process inside rootfs |
@@ -48,6 +48,8 @@ pub(super) struct ContainerBuilderImpl { | |||
pub detached: bool, | |||
/// Default executes the specified execution of a generic command | |||
pub executor: Box<dyn Executor>, | |||
/// If do not use pivot root to jail process inside rootfs |
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.
/// If do not use pivot root to jail process inside rootfs | |
/// If do not use pivot root to container process inside rootfs |
This pr supports setting no_pivot_root for create and run command,
what no_pivot means refer to https://github.com/opencontainers/runc/blob/main/man/runc-create.8.md
As pivot_root could not work with initramfs, youki create failed when container rootfs is on initramfs, so supporting to disable it and replace with chroot is needed.