-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Create the /etc/mtab file if does not exists #10270
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
All kinds of red unhappy tests @rhatdan |
Can we do this with a bind mount of the link? As is, we’re creating a file
that will show up in diff, be committed with user changes, etc
…On Fri, May 7, 2021 at 17:07 Tom Sweeney ***@***.***> wrote:
All kinds of red unhappy tests @rhatdan <https://github.com/rhatdan>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#10270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCHXF3FXI4HOOIIWYNLTMRJANANCNFSM44K4KRSA>
.
|
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.
LGTM
@mheon We already do this, with /etc/resolv.conf and /etc/hosts, if they do not exist in the base image. We could create an empty file for the inode and mount over it, but I am not sure this is better then setting up the image with the symbolic link, which BTW almost all images have by default, which is why we never caught this until now. We can talk at standup about potentially special handling the additional mount inodes we add to images. |
We bind-mount hosts, resolv, and most others (with a few notable
exceptions) - it seems more sane than creating files in the container’s own
RW layer unless there is a good reason not to
…On Mon, May 10, 2021 at 06:28 Daniel J Walsh ***@***.***> wrote:
@mheon <https://github.com/mheon> We already do this, with
/etc/resolv.conf and /etc/hosts, if they do not exist in the base image. We
could create an empty file for the inode and mount over it, but I am not
sure this is better then setting up the image with the symbolic link, which
BTW almost all images have by default, which is why we never caught this
until now. We can talk at standup about potentially special handling the
additional mount inodes we add to images.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10270 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCHAOCIYW4NUPD63SVLTM6YNXANCNFSM44K4KRSA>
.
|
68304f6
to
4f25aa5
Compare
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 a nit that could be addressed later,
LGTM
libpod/container_internal.go
Outdated
if _, err := os.Lstat(mtab); err != nil { | ||
if err = os.Symlink("/proc/mounts", mtab); 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.
could this be simplified as?
if err = os.Symlink("/proc/mounts", mtab); err != nil && !os.IsExist(err) {
return "", err
}
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
We should create the /etc/mtab->/proc/mountinfo link so that mount command will work within the container. Docker does this by default. Fixes: containers#10263 Signed-off-by: Daniel J Walsh <[email protected]>
We should create the /etc/mtab->/proc/mountinfo link
so that mount command will work within the container.
Docker does this by default.
Fixes: #10263
Signed-off-by: Daniel J Walsh [email protected]