Skip to content

Commit 58f6675

Browse files
committed
Merge pull request #153 from cloudfoundry-incubator/namespace-enums
Define constants for Linux Namespace names
2 parents 527a3ee + 4728225 commit 58f6675

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

runtime_config_linux.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,24 @@ type LinuxRuntime struct {
4141
// Namespace is the configuration for a linux namespace.
4242
type Namespace struct {
4343
// Type is the type of Linux namespace
44-
Type string `json:"type"`
44+
Type NamespaceType `json:"type"`
4545
// Path is a path to an existing namespace persisted on disk that can be joined
4646
// and is of the same type
4747
Path string `json:"path"`
4848
}
4949

50+
// NamespaceType is one of the linux namespaces
51+
type NamespaceType string
52+
53+
const (
54+
PIDNamespace NamespaceType = "pid"
55+
NetworkNamespace = "network"
56+
MountNamespace = "mount"
57+
IPCNamespace = "ipc"
58+
UTSNamespace = "uts"
59+
UserNamespace = "user"
60+
)
61+
5062
// IDMapping specifies UID/GID mappings
5163
type IDMapping struct {
5264
// HostID is the UID/GID of the host user or group

0 commit comments

Comments
 (0)