-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Manage ns: manage pid #3910
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
Manage ns: manage pid #3910
Conversation
|
/test e2e_rhel |
b9b84ce to
bd0ae27
Compare
|
mount is getting EPERM'd in unit tests :( |
bd0ae27 to
47a7e29
Compare
47a7e29 to
da5e654
Compare
ec2dde8 to
a291448
Compare
a291448 to
1b01a85
Compare
85574c9 to
324a47b
Compare
|
/retest |
saschagrunert
left a comment
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.
Just found some nits, otherwise LGTM 👏
| } | ||
| for _, namespaceToJoin := range namespacesToJoin { | ||
| path, err := configNsPath(&m, namespaceToJoin.rspecNS) | ||
| if err == nil { |
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.
What to do if the error is not nil? Log it or return?
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.
we ignore. If it errors, the namespaces were not managed
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Other than @saschagrunert 's comments, LGTM |
|
/retest |
5b48d84 to
af76399
Compare
|
/retest |
1 similar comment
|
/retest |
/retest |
af76399 to
bf5e5bf
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
bf5e5bf to
d79d94e
Compare
dang |
4e35af9 to
c07341a
Compare
|
/retest |
pid namespaces were special cased as a namespace that was not managed, because they function differently For the other namespaces, we can pass a new namespace to the runtime when that namespace is private to the pod However, it would be a bother creating a new pid namespace (conmon would have to unshare the namespace, then do the bind mount) Instead, mount the pid namespace *after* the sandbox is created. This way, the infra container's runtime config doesn't list the namespace (more on that below) but subsequent containers created can join the namespace, instead of the proc entry. This further protects us from pid wrap A consequence of not adding the file to the config is the restore case is a bit odd. The other namespaces can join the namespace listed in the restored config.json, but the pid namespace is not saved in its config json. Work around this by saving the pidns location to the infra container's runDir this PR also adds unit tests, and refactors a couple of things to make tests pass Signed-off-by: Peter Hunt <[email protected]>
c07341a to
57b7856
Compare
|
/retest |
|
@haircommander: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@haircommander: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
A friendly reminder that this PR had no activity for 30 days. |
|
@haircommander: The following tests failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@haircommander: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
I think we're not going to do this now. Hopefully eventually we can drop the infra container entirely |
What type of PR is this?
/kind bug
What this PR does / why we need it:
pid namespaces were special cased as a namespace that was not managed, because they function differently
For the other namespaces, we can pass a new namespace to the runtime when that namespace is private to the pod
However, it would be a bother creating a new pid namespace (conmon would have to unshare the namespace, then do the bind mount)
Instead, mount the pid namespace after the sandbox is created. This way, the infra container's runtime config doesn't list the namespace (more on that below)
but subsequent containers created can join the namespace, instead of the proc entry. This further protects us from pid wrap
A consequence of not adding the file to the config is the restore case is a bit odd. The other namespaces can join the namespace listed in the restored config.json,
but the pid namespace is not saved in its config json.
Work around this by saving the pidns location to the infra container's runDir
this PR also adds unit tests, and refactors a couple of things to make tests pass
Which issue(s) this PR fixes:
Special notes for your reviewer:
build on top of #3868
Does this PR introduce a user-facing change?