Merge pull request #917 from KentaTada:fix-clone-flags
PiperOrigin-RevId: 272262368
This commit is contained in:
commit
90e908f419
|
@ -33,19 +33,19 @@ import (
|
||||||
func nsCloneFlag(nst specs.LinuxNamespaceType) uintptr {
|
func nsCloneFlag(nst specs.LinuxNamespaceType) uintptr {
|
||||||
switch nst {
|
switch nst {
|
||||||
case specs.IPCNamespace:
|
case specs.IPCNamespace:
|
||||||
return syscall.CLONE_NEWIPC
|
return unix.CLONE_NEWIPC
|
||||||
case specs.MountNamespace:
|
case specs.MountNamespace:
|
||||||
return syscall.CLONE_NEWNS
|
return unix.CLONE_NEWNS
|
||||||
case specs.NetworkNamespace:
|
case specs.NetworkNamespace:
|
||||||
return syscall.CLONE_NEWNET
|
return unix.CLONE_NEWNET
|
||||||
case specs.PIDNamespace:
|
case specs.PIDNamespace:
|
||||||
return syscall.CLONE_NEWPID
|
return unix.CLONE_NEWPID
|
||||||
case specs.UTSNamespace:
|
case specs.UTSNamespace:
|
||||||
return syscall.CLONE_NEWUTS
|
return unix.CLONE_NEWUTS
|
||||||
case specs.UserNamespace:
|
case specs.UserNamespace:
|
||||||
return syscall.CLONE_NEWUSER
|
return unix.CLONE_NEWUSER
|
||||||
case specs.CgroupNamespace:
|
case specs.CgroupNamespace:
|
||||||
panic("cgroup namespace has no associated clone flag")
|
return unix.CLONE_NEWCGROUP
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("unknown namespace %v", nst))
|
panic(fmt.Sprintf("unknown namespace %v", nst))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue