-
Notifications
You must be signed in to change notification settings - Fork 160
validate: Drop mount checks #73
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
Conversation
|
And somewhat related to “more trouble than we want to get into” is opencontainers/runtime-spec#418, which allows the runtime to not validate every possible thing before asking the kernel to do it ;). And in |
|
I am okay removing this check but would like to hear @liangchenye opinion as well. |
|
Needs rebase. |
|
On Mon, May 23, 2016 at 09:26:19AM -0700, Mrunal Patel wrote:
Rebased with 2eaec20 → 3b9d616. |
|
github is still complaining about conflicts. |
These landed as CheckMounts in 647e355 (bundle validate update to 0.3.0, 2016-02-23, opencontainers#20), but both checks are too strict. The first (destination exists in the rootfs) errors on valid cases like: "mounts": [ { "source": "users", "destination": "/home", "type": "bind" }, { "source": "none", "destination": "/home/wking", "type": "tmpfs" } ] Where the source 'users' directory already contained a 'wking' subdirectory. So by the time the tmpfs was setup, the destination directory would exist, but at validation time (without having run the bind mount) the tmpfs destination directory would not exist. The second (destination is a directory) errors on valid cases like: "mounts": [ { "source": "/etc/resolv.conf", "destination": "/etc/resolv.conf", "type": "bind" } ] because binding files to files works. In a shell: # touch test # mount --bind /etc/resolv.conf test # umount test However binding directories to files does not work: # mount --bind /etc test mount: mount point /tmp/test is not a directory Figuring out which mount configurations are valid and which aren't may be possible, but I'm pretty sure it's more trouble than we want to get into. There may be room for other mount tests (e.g. comparing 'type' against /proc/filesystems as a host-specific test), but I'm leaving those to subsequent pull requests. Signed-off-by: W. Trevor King <wking@tremily.us>
|
On Mon, May 23, 2016 at 09:31:19AM -0700, Mrunal Patel wrote:
Odd, I'd pushed the commit 1. I just bumped the commit date to get |
|
@wking Can you open a new PR? |
3b9d616 to
db4632b
Compare
|
LGTM. Looks like github was probably slow in updating merge status. |
These landed as CheckMounts in 647e355 (bundle validate update to
0.3.0, 2016-02-23, #20), but both checks are too strict.
The first (destination exists in the rootfs) errors on valid cases
like:
Where the source
usersdirectory already contained awkingsubdirectory. So by the time the tmpfs was setup, the destination
directory would exist, but at validation time (without having run the
bind mount) the tmpfs destination directory would not exist.
The second (destination is a directory) errors on valid cases like:
because binding files to files works. In a shell:
However binding directories to files does not work:
Figuring out which mount configurations are valid and which aren't may
be possible, but I'm pretty sure it's more trouble than we want to get
into. There may be room for other mount tests (e.g. comparing
typeagainst
/proc/filesystemsas a host-specific test), but I'm leavingthose to subsequent pull requests.