-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
libcontainer: improve "kernel.{domainname,hostname}" sysctl handling #1827
libcontainer: improve "kernel.{domainname,hostname}" sysctl handling #1827
Conversation
These sysctls are namespaced by CLONE_NEWUTS, and we need to use "kernel.domainname" if we want users to be able to set an NIS domainname on Linux. However we disallow "kernel.hostname" because it would conflict with the "hostname" field and cause confusion (but we include a helpful message to make it clearer to the user). Signed-off-by: Aleksa Sarai <asarai@suse.de>
This is a part of moby/moby#37302. |
switch s { | ||
case "kernel.domainname": | ||
// This is namespaced and there's no explicit OCI field for it. | ||
continue |
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.
i dont think we need to explicitly single out kernel.domainname
here since its not a TODO for OCI either right ?
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.
This code is allowing kernel.domainname
-- which is why it needs to be singled out (the comment explains why it's allowed and kernel.hostname
isn't). If you try to use kernel.domainname
without this patch it will fail because runc
thinks its not namespaced and fails container creation.
We also can't enable everything under kernel.
.
/cc @opencontainers/runc-maintainers |
These sysctls are namespaced by CLONE_NEWUTS, and we need to use
"kernel.domainname" if we want users to be able to set an NIS domainname
on Linux. However we disallow "kernel.hostname" because it would
conflict with the "hostname" field and cause confusion (but we include a
helpful message to make it clearer to the user).
Signed-off-by: Aleksa Sarai asarai@suse.de