runsc: add the clone flag of cgroup namespace

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
This commit is contained in:
Kenta Tada 2019-09-26 11:59:13 +09:00
parent dd0e5eedae
commit 69f3c79b24
1 changed files with 7 additions and 7 deletions

View File

@ -33,19 +33,19 @@ import (
func nsCloneFlag(nst specs.LinuxNamespaceType) uintptr {
switch nst {
case specs.IPCNamespace:
return syscall.CLONE_NEWIPC
return unix.CLONE_NEWIPC
case specs.MountNamespace:
return syscall.CLONE_NEWNS
return unix.CLONE_NEWNS
case specs.NetworkNamespace:
return syscall.CLONE_NEWNET
return unix.CLONE_NEWNET
case specs.PIDNamespace:
return syscall.CLONE_NEWPID
return unix.CLONE_NEWPID
case specs.UTSNamespace:
return syscall.CLONE_NEWUTS
return unix.CLONE_NEWUTS
case specs.UserNamespace:
return syscall.CLONE_NEWUSER
return unix.CLONE_NEWUSER
case specs.CgroupNamespace:
panic("cgroup namespace has no associated clone flag")
return unix.CLONE_NEWCGROUP
default:
panic(fmt.Sprintf("unknown namespace %v", nst))
}