Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Commit

Permalink
container: remove the unused ns from ocispec
Browse files Browse the repository at this point in the history
Only keep the pidns and mntns for those containers
in sandbox/pod.

Signed-off-by: fupan <[email protected]>
  • Loading branch information
lifupan committed Jul 12, 2018
1 parent 9f5d2d4 commit 9d2bee1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions daemon/pod/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,18 @@ func (c *Container) containerConfig(cjson *dockertypes.ContainerJSON) (*vc.Conta
}

ociSpec = c.ociSpec(cjson)

//remove those namespace types from ocispec
for _, ns := range []specs.LinuxNamespaceType{
specs.NetworkNamespace,
specs.UserNamespace,
specs.UTSNamespace,
specs.IPCNamespace,
specs.CgroupNamespace,
} {
oci.RemoveNamespace(ociSpec, ns)
}

ociSpecJson, err := json.Marshal(ociSpec)
if err != nil {
return &vc.ContainerConfig{}, nil
Expand Down

0 comments on commit 9d2bee1

Please sign in to comment.