Merge pull request #153 from cloudfoundry-incubator/namespace-enums

Define constants for Linux Namespace names
This commit is contained in:
Vincent Batts 2015-09-04 14:35:42 -04:00
commit 58f6675696
1 changed files with 13 additions and 1 deletions

View File

@ -41,12 +41,24 @@ type LinuxRuntime struct {
// Namespace is the configuration for a linux namespace.
type Namespace struct {
// Type is the type of Linux namespace
Type string `json:"type"`
Type NamespaceType `json:"type"`
// Path is a path to an existing namespace persisted on disk that can be joined
// and is of the same type
Path string `json:"path"`
}
// NamespaceType is one of the linux namespaces
type NamespaceType string
const (
PIDNamespace NamespaceType = "pid"
NetworkNamespace = "network"
MountNamespace = "mount"
IPCNamespace = "ipc"
UTSNamespace = "uts"
UserNamespace = "user"
)
// IDMapping specifies UID/GID mappings
type IDMapping struct {
// HostID is the UID/GID of the host user or group