Merge pull request #154 from vbatts/golint

runtime_config: comments for golint
This commit is contained in:
Mrunal Patel 2015-09-04 14:16:52 -07:00
commit 9d59c53bbf
2 changed files with 20 additions and 9 deletions

View File

@ -1,5 +1,6 @@
package specs package specs
// RuntimeSpec is the generic runtime state information on a running container
type RuntimeSpec struct { type RuntimeSpec struct {
// Mounts is a mapping of names to mount configurations. // Mounts is a mapping of names to mount configurations.
// Which mounts will be mounted and where should be chosen with MountPoints // Which mounts will be mounted and where should be chosen with MountPoints
@ -9,13 +10,14 @@ type RuntimeSpec struct {
Hooks Hooks `json:"hooks"` Hooks Hooks `json:"hooks"`
} }
// Hook specifies a command that is run at a particular event in the lifecycle of a container. // Hook specifies a command that is run at a particular event in the lifecycle of a container
type Hook struct { type Hook struct {
Path string `json:"path"` Path string `json:"path"`
Args []string `json:"args"` Args []string `json:"args"`
Env []string `json:"env"` Env []string `json:"env"`
} }
// Hooks for container setup and teardown
type Hooks struct { type Hooks struct {
// Prestart is a list of hooks to be run before the container process is executed. // Prestart is a list of hooks to be run before the container process is executed.
// On Linux, they are run after the container namespaces are created. // On Linux, they are run after the container namespaces are created.
@ -24,7 +26,7 @@ type Hooks struct {
Poststop []Hook `json:"poststop"` Poststop []Hook `json:"poststop"`
} }
// Mount specifies a mount for a container. // Mount specifies a mount for a container
type Mount struct { type Mount struct {
// Type specifies the mount kind. // Type specifies the mount kind.
Type string `json:"type"` Type string `json:"type"`

View File

@ -12,6 +12,7 @@ type LinuxRuntimeSpec struct {
Linux LinuxRuntime `json:"linux"` Linux LinuxRuntime `json:"linux"`
} }
// LinuxRuntime hosts the Linux-only runtime information
type LinuxRuntime struct { type LinuxRuntime struct {
// UIDMapping specifies user mappings for supporting user namespaces on linux. // UIDMapping specifies user mappings for supporting user namespaces on linux.
UIDMappings []IDMapping `json:"uidMappings"` UIDMappings []IDMapping `json:"uidMappings"`
@ -38,7 +39,7 @@ type LinuxRuntime struct {
RootfsPropagation string `json:"rootfsPropagation"` RootfsPropagation string `json:"rootfsPropagation"`
} }
// Namespace is the configuration for a linux namespace. // Namespace is the configuration for a linux namespace
type Namespace struct { type Namespace struct {
// Type is the type of Linux namespace // Type is the type of Linux namespace
Type NamespaceType `json:"type"` Type NamespaceType `json:"type"`
@ -51,12 +52,18 @@ type Namespace struct {
type NamespaceType string type NamespaceType string
const ( const (
PIDNamespace NamespaceType = "pid" // PIDNamespace for isolating process IDs
NetworkNamespace = "network" PIDNamespace NamespaceType = "pid"
MountNamespace = "mount" // NetworkNamespace for isolating network devices, stacks, ports, etc
IPCNamespace = "ipc" NetworkNamespace = "network"
UTSNamespace = "uts" // MountNamespace for isolating mount points
UserNamespace = "user" MountNamespace = "mount"
// IPCNamespace for isolating System V IPC, POSIX message queues
IPCNamespace = "ipc"
// UTSNamespace for isolating hostname and NIS domain name
UTSNamespace = "uts"
// UserNamespace for isolating user and group IDs
UserNamespace = "user"
) )
// IDMapping specifies UID/GID mappings // IDMapping specifies UID/GID mappings
@ -141,6 +148,7 @@ type CPU struct {
Mems string `json:"mems"` Mems string `json:"mems"`
} }
// Pids for Linux cgroup 'pids' resource management (Linux 4.3)
type Pids struct { type Pids struct {
// Maximum number of PIDs. A value < 0 implies "no limit". // Maximum number of PIDs. A value < 0 implies "no limit".
Limit int64 `json:"limit"` Limit int64 `json:"limit"`
@ -172,6 +180,7 @@ type Resources struct {
Network Network `json:"network"` Network Network `json:"network"`
} }
// Device represents the information on a Linux special device file
type Device struct { type Device struct {
// Path to the device. // Path to the device.
Path string `json:"path"` Path string `json:"path"`