Export more functions from libcontainer

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-04-30 17:18:07 -07:00
parent aecfa0d890
commit 2db754f3ee
5 changed files with 26 additions and 22 deletions

View file

@ -142,3 +142,14 @@ func DeletePid(path string) error {
}
return err
}
// GetNamespaceFlags parses the container's Namespaces options to set the correct
// flags on clone, unshare, and setns
func GetNamespaceFlags(namespaces libcontainer.Namespaces) (flag int) {
for _, ns := range namespaces {
if ns.Enabled {
flag |= ns.Value
}
}
return flag
}