Skip to content

Detect and forbid duplicated namespace in spec#1150

Merged
hqhq merged 1 commit intoopencontainers:masterfrom
WeiZhang555:forbid-duplicated-namespace
Oct 27, 2016
Merged

Detect and forbid duplicated namespace in spec#1150
hqhq merged 1 commit intoopencontainers:masterfrom
WeiZhang555:forbid-duplicated-namespace

Conversation

@WeiZhang555
Copy link
Copy Markdown
Contributor

@WeiZhang555 WeiZhang555 commented Oct 26, 2016

When spec file contains duplicated namespaces, e.g.

specs: specs.Spec{
        Linux: &specs.Linux{
            Namespaces: []specs.Namespace{
                {
                    Type: "pid",
                },
                {
                    Type: "pid",
                    Path: "/proc/1/ns/pid",
                },
            },
        },
    }

runc should report malformed spec instead of using latest one by
default, because this spec could be quite confusing.

Signed-off-by: Zhang Wei zhangwei555@huawei.com

When spec file contains duplicated namespaces, e.g.

specs: specs.Spec{
        Linux: &specs.Linux{
            Namespaces: []specs.Namespace{
                {
                    Type: "pid",
                },
                {
                    Type: "pid",
                    Path: "/proc/1/ns/pid",
                },
            },
        },
    }

runc should report malformed spec instead of using latest one by
default, because this spec could be quite confusing.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
@wking
Copy link
Copy Markdown
Contributor

wking commented Oct 26, 2016 via email

@cyphar
Copy link
Copy Markdown
Member

cyphar commented Oct 26, 2016

While I'm fine with this, I'd prefer to get a runtime-spec PR landed first.

@mrunalp
Copy link
Copy Markdown
Contributor

mrunalp commented Oct 26, 2016

LGTM

Approved with PullApprove

@WeiZhang555
Copy link
Copy Markdown
Contributor Author

@cyphar I can do that at the same time :)
If runc is OK for this, I think runtime-spec won't reject this either 😝

@WeiZhang555
Copy link
Copy Markdown
Contributor Author

@wking So if that spec change was accepted, I think this could make more sense.
I'm glad to help making the PR if you don't mind. 😄

@hqhq
Copy link
Copy Markdown
Contributor

hqhq commented Oct 27, 2016

LGTM

Approved with PullApprove

@hqhq hqhq merged commit e7abf30 into opencontainers:master Oct 27, 2016
@WeiZhang555 WeiZhang555 deleted the forbid-duplicated-namespace branch October 27, 2016 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants