libcontainer: use consts of Namespace from runtime-spec

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
This commit is contained in:
Kenta Tada 2020-04-19 23:21:40 +09:00
parent bf0a8e1747
commit 3de8613327
1 changed files with 6 additions and 6 deletions

View File

@ -139,26 +139,26 @@ func Example() *specs.Spec {
},
Namespaces: []specs.LinuxNamespace{
{
Type: "pid",
Type: specs.PIDNamespace,
},
{
Type: "network",
Type: specs.NetworkNamespace,
},
{
Type: "ipc",
Type: specs.IPCNamespace,
},
{
Type: "uts",
Type: specs.UTSNamespace,
},
{
Type: "mount",
Type: specs.MountNamespace,
},
},
},
}
if cgroups.IsCgroup2UnifiedMode() {
spec.Linux.Namespaces = append(spec.Linux.Namespaces, specs.LinuxNamespace{
Type: "cgroup",
Type: specs.CgroupNamespace,
})
}
return spec