Skip to content

Commit 752f35c

Browse files
committed
runtime_config: comments for golint
Signed-off-by: Vincent Batts <[email protected]>
1 parent 58f6675 commit 752f35c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

runtime_config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package specs
22

3+
// RuntimeSpec is the generic runtime state information on a running container
34
type RuntimeSpec struct {
45
// Mounts is a mapping of names to mount configurations.
56
// Which mounts will be mounted and where should be chosen with MountPoints
@@ -9,13 +10,14 @@ type RuntimeSpec struct {
910
Hooks Hooks `json:"hooks"`
1011
}
1112

12-
// Hook specifies a command that is run at a particular event in the lifecycle of a container.
13+
// Hook specifies a command that is run at a particular event in the lifecycle of a container
1314
type Hook struct {
1415
Path string `json:"path"`
1516
Args []string `json:"args"`
1617
Env []string `json:"env"`
1718
}
1819

20+
// Hooks for container setup and teardown
1921
type Hooks struct {
2022
// Prestart is a list of hooks to be run before the container process is executed.
2123
// On Linux, they are run after the container namespaces are created.
@@ -24,7 +26,7 @@ type Hooks struct {
2426
Poststop []Hook `json:"poststop"`
2527
}
2628

27-
// Mount specifies a mount for a container.
29+
// Mount specifies a mount for a container
2830
type Mount struct {
2931
// Type specifies the mount kind.
3032
Type string `json:"type"`

runtime_config_linux.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type LinuxRuntimeSpec struct {
1212
Linux LinuxRuntime `json:"linux"`
1313
}
1414

15+
// LinuxRuntime hosts the Linux-only runtime information
1516
type LinuxRuntime struct {
1617
// UIDMapping specifies user mappings for supporting user namespaces on linux.
1718
UIDMappings []IDMapping `json:"uidMappings"`
@@ -38,7 +39,7 @@ type LinuxRuntime struct {
3839
RootfsPropagation string `json:"rootfsPropagation"`
3940
}
4041

41-
// Namespace is the configuration for a linux namespace.
42+
// Namespace is the configuration for a linux namespace
4243
type Namespace struct {
4344
// Type is the type of Linux namespace
4445
Type NamespaceType `json:"type"`
@@ -51,12 +52,18 @@ type Namespace struct {
5152
type NamespaceType string
5253

5354
const (
54-
PIDNamespace NamespaceType = "pid"
55-
NetworkNamespace = "network"
56-
MountNamespace = "mount"
57-
IPCNamespace = "ipc"
58-
UTSNamespace = "uts"
59-
UserNamespace = "user"
55+
// PIDNamespace for isolating process IDs
56+
PIDNamespace NamespaceType = "pid"
57+
// NetworkNamespace for isolating network devices, stacks, ports, etc
58+
NetworkNamespace = "network"
59+
// MountNamespace for isolating mount points
60+
MountNamespace = "mount"
61+
// IPCNamespace for isolating System V IPC, POSIX message queues
62+
IPCNamespace = "ipc"
63+
// UTSNamespace for isolating hostname and NIS domain name
64+
UTSNamespace = "uts"
65+
// UserNamespace for isolating user and group IDs
66+
UserNamespace = "user"
6067
)
6168

6269
// IDMapping specifies UID/GID mappings
@@ -141,6 +148,7 @@ type CPU struct {
141148
Mems string `json:"mems"`
142149
}
143150

151+
// Pids for Linux cgroup 'pids' resource management (Linux 4.3)
144152
type Pids struct {
145153
// Maximum number of PIDs. A value < 0 implies "no limit".
146154
Limit int64 `json:"limit"`
@@ -172,6 +180,7 @@ type Resources struct {
172180
Network Network `json:"network"`
173181
}
174182

183+
// Device represents the information on a Linux special device file
175184
type Device struct {
176185
// Path to the device.
177186
Path string `json:"path"`

0 commit comments

Comments
 (0)