2014-02-21 02:27:42 +00:00
|
|
|
package nsinit
|
2014-02-19 00:56:11 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/dotcloud/docker/pkg/libcontainer"
|
|
|
|
)
|
|
|
|
|
2014-02-19 07:13:36 +00:00
|
|
|
// getNamespaceFlags parses the container's Namespaces options to set the correct
|
|
|
|
// flags on clone, unshare, and setns
|
2014-02-22 01:11:57 +00:00
|
|
|
func GetNamespaceFlags(namespaces libcontainer.Namespaces) (flag int) {
|
2014-02-19 07:13:36 +00:00
|
|
|
for _, ns := range namespaces {
|
2014-02-25 05:52:29 +00:00
|
|
|
flag |= ns.Value
|
2014-02-19 07:13:36 +00:00
|
|
|
}
|
2014-02-19 22:33:25 +00:00
|
|
|
return flag
|
2014-02-19 07:13:36 +00:00
|
|
|
}
|