-
Notifications
You must be signed in to change notification settings - Fork 36
fix: clarify comments in molecule.Mount and lxcRootfsString #494
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
fix: clarify comments in molecule.Mount and lxcRootfsString #494
Conversation
83834fe
to
2bc1e6f
Compare
The comment is true if there are no upperdirs. I couldn't easily tell with quick code inspection - do you know whether this path can happen with no upperdir? |
moved from chat to avoid getting it lost: I think the comment is wrong, but isn't it possible for there to be a molecule with just one atom? |
Thanks for pushing. You're right. I wasn't thinking about the fact that the molecule mount actually just mounts read-only. I didn't realize that there was a limitation if you didn't use an upperdir. If you don't have an upperdir, then you need more than one lowerdir. That doesn't seem like it would have to be so, but it currently is. A mount with one lowerdir and no upperdir would just be effectively a bind 'mount -o ro,bind'. Just to clarify for myself, some shell snippets below. 'unshared' func just allows unpriv mounts. To summarize what I have found:
|
2bc1e6f
to
1da68ae
Compare
molecule.overlayArgs provides options for a kernel mount-option string. Kernel mount options for overlay require *more* than one lowerdir if there is no upperdir. molecule.Mount always performs read-only mounts (thus no upperdir). So molecule.overlayArgs must add a workaround lowerdir if there is only one. Separately, lxcRootfsString function returns a string to be supplied to lxc's lxc.rootfs.path. lxc.rootfs.path is of the form: overlayfs:lowerdir[:lowerdir2:lowerdir3]:upperdir. It requires 1 or more lowerdirs and an upperdir. So in lxcRootfsString we need to create a workaround dir only if there are zero lowerdirs (an empty container). Signed-off-by: Scott Moser <smoser@brickies.net>
1da68ae
to
01ed425
Compare
OK, Sorry for the confusion and for taking you all down the rathole with me. Now this PR is a comment-only change. Hopefully it commit message and the comments changes are an improvement. |
fix: clarify comments in molecule.Mount and lxcRootfsString
molecule.overlayArgs provides options for a kernel mount-option string.
Kernel mount options for overlay require more than one lowerdir if
there is no upperdir. molecule.Mount always performs read-only
mounts (thus no upperdir). So molecule.overlayArgs must add
a workaround lowerdir if there is only one.
Separately, lxcRootfsString function returns a string to be supplied to
lxc's lxc.rootfs.path. lxc.rootfs.path is of the form:
overlayfs:lowerdir[:lowerdir2:lowerdir3]:upperdir.
It requires 1 or more lowerdirs and an upperdir.
So in lxcRootfsString we need to create a workaround dir only if there
are zero lowerdirs (an empty container).
Signed-off-by: Scott Moser smoser@brickies.net
this is a follow-on to #493