-
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
allow bind mount w/o explicit "bind" opt but w/ explicit "bind" type #2590
allow bind mount w/o explicit "bind" opt but w/ explicit "bind" type #2590
Conversation
Previously, {"type":"bind"} without {"options": ["bind"]} was failing with ENODEV. See containers/podman#7652 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
||
runc run test_bind_mount | ||
[ "$status" -eq 0 ] | ||
[[ "${lines[0]}" == *'/tmp/bind/config.json'* ]] |
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 will also match something like "ls: /tmp/bind/config.json: no such file or directory" which is not good.
I think we should list the directory instead, and check the file is present in the output.
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 check the status code, so it won't match ls: /tmp/bind/config.json: no such file or directory
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.
well in this case it does not make sense to check the output, since ls
will definitely return the error if the file is not there, so this check is redundant
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.
So I guess either
- list the directory, check the exit code, check the output to contain file name
or
- list the file, check the exit code
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.
test case needs fixing
The test should be ok, please see #2590 (comment) |
I would argue the config is wrong -- I do see why we'd want to add it, but it means that a hypothetical filesystem called |
As crun doesn't require this option, projects using crun as the primary runtime are likely to forget adding this option. containers/podman#7652
This sounds too much hypothetical. When a new kind of "bind" filesystem is being added to the kernel, probably it will be called in another name like "bind2", to avoid breaking userspace |
That means crun is not implementing the runtime-spec correctly (or rather, is implementing an extension to the runtime-spec). To quote the spec:
I'm not against adding something as simple as this workaround, but just because crun (or runc for that matter) does something doesn't make it the correct behaviour. Podman shouldn't be generating invalid OCI configurations.
|
I'll fix it in crun to follow more closely the OCI specs. |
Previously,
{"type":"bind"}
without{"options": ["bind"]}
was failing with ENODEV.See containers/podman#7652