Skip to content
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

what happen if set mount path in linux namespaces and mounts in spec at the same time #155

Closed
gao-feng opened this issue Sep 6, 2015 · 5 comments

Comments

@gao-feng
Copy link
Contributor

gao-feng commented Sep 6, 2015

Allow joining-to-mnt-ns to change the existing mount info? or mounts in spec should be ignored?

"mounts": {
    "data": {
        "type": "bind",
        "source": "/data",
        "options": ["rw"]
    }
    ...
}
"linux": {
    "namespaces" : [
        {
            "type": "mount",
            "path": "/proc/1234/ns/pid"
        }
        ...
    ]
    ...
}
@wking
Copy link
Contributor

wking commented Sep 6, 2015

On Sun, Sep 06, 2015 at 02:10:59AM -0700, Gao feng wrote:

Allow joining-to-mnt-ns to change the existing mount info? or mounts
in spec should be ignored?

I see two options that sound reasonable:

a. Mount config.json's mounts and then join runtime.json's mount
namespace(s).
b. Join runtime.json's mount namespace(s) and then mount config.json's
mounts.

Folks who don't want to change mounts can always remove the mounts
entry from their config.json.

I don't have a strong preference between (a) and (b), but (a)'s
outside-of-namespace mounts could be handled by hooks (which I think
are executed from the host's namespaces 1), so maybe it's better to
do (b) for config-side mounts.

@gao-feng
Copy link
Contributor Author

gao-feng commented Sep 7, 2015

Allow to change the mounts info of existed mnt ns? what's happen if config.json specified rootfs? allow to change the rootfs of mnt ns?

@wking
Copy link
Contributor

wking commented Sep 7, 2015

On Sun, Sep 06, 2015 at 11:21:26PM -0700, Gao feng wrote:

Allow to change the mounts info of existed mnt ns? what's happen if
config.json specified rootfs? allow to change the rootfs of mnt ns?

What does the ‘root’ entry actually do anyway? I'd guess it just sets
up the mount namespace and tweaks R/W, propagation, etc. when doing
that. So I'd suggest we error out with an “invalid config” error if
we have both a ‘root’ entry and a mount-path under linux.namespaces.

@mrunalp
Copy link
Contributor

mrunalp commented Sep 8, 2015

@gao-feng The idea behind joining the existing namespaces is that no setup is required to be done in those namespaces by the runtime. I will create a PR to clarify that in the spec.

@mrunalp
Copy link
Contributor

mrunalp commented Sep 8, 2015

Created #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants