Skip to content
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

organize the process around the namespace in init #371

Merged
merged 3 commits into from
Oct 9, 2021

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented Oct 8, 2021

No description provided.

@utam0k utam0k requested a review from yihuaf October 8, 2021 02:24
@codecov-commenter
Copy link

Codecov Report

Merging #371 (bdb17e9) into main (07d925a) will increase coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #371      +/-   ##
==========================================
+ Coverage   73.15%   73.17%   +0.02%     
==========================================
  Files          48       48              
  Lines        7721     7717       -4     
==========================================
- Hits         5648     5647       -1     
+ Misses       2073     2070       -3     

// namespace. We also have to enter into mount namespace last since
// namespace may be bind to /proc path. The /proc path will need to be
// accessed before pivot_root.
fn apply_rest_namespaces(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we should refactor this into a separate function. The namespaces logic is already isolated to namespaces.apply_namespaces call. The rest bits will give us the flexibility to control the order of these operations, which sometimes can be important.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. I am going to add a test by isolating it to a function. Do you have any good names or ways to separate them?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are already tests for namespaces.apply_namespaces. If not, that's where we should write the test related to entering into namespaces.

Or if you want to test the host name change part together with this, then we can use the current change. If we need to move things around later, then let's worry about it later.

Copy link
Collaborator

@yihuaf yihuaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this now and worry about the potential change when we get there.

@utam0k utam0k merged commit f1acccb into youki-dev:main Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants