From 47282257b89fbbdb013e8bf38aa2eeec6fa5f6a2 Mon Sep 17 00:00:00 2001 From: Julian Friedman Date: Fri, 4 Sep 2015 19:22:11 +0100 Subject: [PATCH] Define constants for Linux Namespace names Signed-off-by: Julian Friedman --- runtime_config_linux.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/runtime_config_linux.go b/runtime_config_linux.go index 37324ed2..3c879449 100644 --- a/runtime_config_linux.go +++ b/runtime_config_linux.go @@ -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