Skip to content

Commit 16aac94

Browse files
author
Michael Crosby
committed
Merge pull request opencontainers#91 from vbatts/vbatts-cleanup
golint
2 parents 9ed6de6 + 8029d26 commit 16aac94

File tree

1 file changed

+62
-55
lines changed

1 file changed

+62
-55
lines changed

spec_linux.go

Lines changed: 62 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,103 +2,107 @@
22

33
package specs
44

5-
// LinuxSpec is the full specification for linux containers.
5+
// LinuxSpec is the full specification for Linux containers
66
type LinuxSpec struct {
77
Spec
8-
// Linux is platform specific configuration for linux based containers.
8+
// Linux is platform specific configuration for Linux based containers
99
Linux Linux `json:"linux"`
1010
}
1111

12-
// Linux contains platform specific configuration for linux based containers.
12+
// Linux contains platform specific configuration for Linux based containers
1313
type Linux struct {
14-
// UidMapping specifies user mappings for supporting user namespaces on linux.
15-
UidMappings []IDMapping `json:"uidMappings"`
16-
// UidMapping specifies group mappings for supporting user namespaces on linux.
17-
GidMappings []IDMapping `json:"gidMappings"`
18-
// Rlimits specifies rlimit options to apply to the container's process.
14+
// UIDMapping specifies user mappings for supporting user namespaces on Linux
15+
UIDMappings []IDMapping `json:"uidMappings"`
16+
// GIDMapping specifies group mappings for supporting user namespaces on Linux
17+
GIDMappings []IDMapping `json:"gidMappings"`
18+
// Rlimits specifies rlimit options to apply to the container's process
1919
Rlimits []Rlimit `json:"rlimits"`
20-
// Sysctl are a set of key value pairs that are set for the container on start.
20+
// Sysctl are a set of key value pairs that are set for the container on start
2121
Sysctl map[string]string `json:"sysctl"`
2222
// Resources contain cgroup information for handling resource constraints
23-
// for the container.
23+
// for the container
2424
Resources Resources `json:"resources"`
25-
// Namespaces contains the namespaces that are created and/or joined by the container.
25+
// Namespaces contains the namespaces that are created and/or joined by the container
2626
Namespaces []Namespace `json:"namespaces"`
27-
// Capabilities are linux capabilities that are kept for the container.
27+
// Capabilities are Linux capabilities that are kept for the container
2828
Capabilities []string `json:"capabilities"`
29-
// Devices are a list of device nodes that are created and enabled for the container.
29+
// Devices are a list of device nodes that are created and enabled for the container
3030
Devices []string `json:"devices"`
31-
// RootfsPropagation is the rootfs mount propagation mode for the container.
31+
// RootfsPropagation is the rootfs mount propagation mode for the container
3232
RootfsPropagation string `json:"rootfsPropagation"`
3333
}
3434

35-
// User specifies linux specific user and group information for the container's
36-
// main process.
35+
// User specifies Linux specific user and group information for the container's
36+
// main process
3737
type User struct {
38-
// Uid is the user id.
39-
Uid int32 `json:"uid"`
40-
// Gid is the group id.
41-
Gid int32 `json:"gid"`
42-
// AdditionalGids are additional group ids set for the container's process.
38+
// Uid is the user id
39+
UID int32 `json:"uid"`
40+
// Gid is the group id
41+
GID int32 `json:"gid"`
42+
// AdditionalGids are additional group ids set for the container's process
4343
AdditionalGids []int32 `json:"additionalGids"`
4444
}
4545

46-
// Namespace is the configuration for a linux namespace.
46+
// Namespace is the configuration for a Linux namespace
4747
type Namespace struct {
48-
// Type is the type of linux namespace.
48+
// Type is the type of Linux namespace
4949
Type string `json:"type"`
5050
// Path is a path to an existing namespace persisted on disk that can be joined
51-
// and is of the same type.
51+
// and is of the same type
5252
Path string `json:"path"`
5353
}
5454

55-
// IDMapping specifies uid/gid mappings.
55+
// IDMapping specifies UID/GID mappings
5656
type IDMapping struct {
57-
// HostID is the uid/gid of the host user or group.
57+
// HostID is the UID/GID of the host user or group
5858
HostID int32 `json:"hostID"`
59-
// ContainerID is the uid/gid of the container's user or group.
59+
// ContainerID is the UID/GID of the container's user or group
6060
ContainerID int32 `json:"containerID"`
61-
// Size is the length of the range of IDs mapped between the two namespaces.
61+
// Size is the length of the range of IDs mapped between the two namespaces
6262
Size int32 `json:"size"`
6363
}
6464

65-
// Rlimit type and restrictions.
65+
// Rlimit type and restrictions
6666
type Rlimit struct {
67-
// Type of the rlimit to set.
67+
// Type of the rlimit to set
6868
Type int `json:"type"`
69-
// Hard is the hard limit for the specified type.
69+
// Hard is the hard limit for the specified type
7070
Hard uint64 `json:"hard"`
71-
// Soft is the soft limit for the specified type.
71+
// Soft is the soft limit for the specified type
7272
Soft uint64 `json:"soft"`
7373
}
7474

75+
// HugepageLimit structure corresponds to limiting kernel hugepages
7576
type HugepageLimit struct {
7677
Pagesize string `json:"pageSize"`
7778
Limit int `json:"limit"`
7879
}
7980

81+
// InterfacePriority for network interfaces
8082
type InterfacePriority struct {
81-
// Name is the name of the network interface.
83+
// Name is the name of the network interface
8284
Name string `json:"name"`
83-
// Priority for the interface.
85+
// Priority for the interface
8486
Priority int64 `json:"priority"`
8587
}
8688

89+
// BlockIO for Linux cgroup 'blockio' resource management
8790
type BlockIO struct {
88-
// Specifies per cgroup weight, range is from 10 to 1000.
91+
// Specifies per cgroup weight, range is from 10 to 1000
8992
Weight int64 `json:"blkioWeight"`
90-
// Weight per cgroup per device, can override BlkioWeight.
93+
// Weight per cgroup per device, can override BlkioWeight
9194
WeightDevice string `json:"blkioWeightDevice"`
92-
// IO read rate limit per cgroup per device, bytes per second.
95+
// IO read rate limit per cgroup per device, bytes per second
9396
ThrottleReadBpsDevice string `json:"blkioThrottleReadBpsDevice"`
94-
// IO write rate limit per cgroup per divice, bytes per second.
97+
// IO write rate limit per cgroup per divice, bytes per second
9598
ThrottleWriteBpsDevice string `json:"blkioThrottleWriteBpsDevice"`
96-
// IO read rate limit per cgroup per device, IO per second.
99+
// IO read rate limit per cgroup per device, IO per second
97100
ThrottleReadIOpsDevice string `json:"blkioThrottleReadIopsDevice"`
98-
// IO write rate limit per cgroup per device, IO per second.
101+
// IO write rate limit per cgroup per device, IO per second
99102
ThrottleWriteIOpsDevice string `json:"blkioThrottleWriteIopsDevice"`
100103
}
101104

105+
// Memory for Linux cgroup 'memory' resource management
102106
type Memory struct {
103107
// Memory limit (in bytes)
104108
Limit int64 `json:"limit"`
@@ -108,45 +112,48 @@ type Memory struct {
108112
Swap int64 `json:"swap"`
109113
// Kernel memory limit (in bytes)
110114
Kernel int64 `json:"kernel"`
111-
// How aggressive the kernel will swap memory pages. Range from 0 to 100. Set -1 to use system default.
115+
// How aggressive the kernel will swap memory pages. Range from 0 to 100. Set -1 to use system default
112116
Swappiness int64 `json:"swappiness"`
113117
}
114118

119+
// CPU for Linux cgroup 'cpu' resource management
115120
type CPU struct {
116-
// CPU shares (relative weight vs. other cgroups with cpu shares).
121+
// CPU shares (relative weight vs. other cgroups with cpu shares)
117122
Shares int64 `json:"shares"`
118-
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
123+
// CPU hardcap limit (in usecs). Allowed cpu time in a given period
119124
Quota int64 `json:"quota"`
120-
// CPU period to be used for hardcapping (in usecs). 0 to use system default.
125+
// CPU period to be used for hardcapping (in usecs). 0 to use system default
121126
Period int64 `json:"period"`
122-
// How many time CPU will use in realtime scheduling (in usecs).
127+
// How many time CPU will use in realtime scheduling (in usecs)
123128
RealtimeRuntime int64 `json:"realtimeRuntime"`
124-
// CPU period to be used for realtime scheduling (in usecs).
129+
// CPU period to be used for realtime scheduling (in usecs)
125130
RealtimePeriod int64 `json:"realtimePeriod"`
126-
// CPU to use within the cpuset.
131+
// CPU to use within the cpuset
127132
Cpus string `json:"cpus"`
128-
// MEM to use within the cpuset.
133+
// MEM to use within the cpuset
129134
Mems string `json:"mems"`
130135
}
131136

137+
// Network identification and priority configuration
132138
type Network struct {
133-
// Set class identifier for container's network packets.
139+
// Set class identifier for container's network packets
134140
ClassID string `json:"classId"`
135-
// Set priority of network traffic for container.
141+
// Set priority of network traffic for container
136142
Priorities []InterfacePriority `json:"priorities"`
137143
}
138144

145+
// Resources has container runtime resource constraints
139146
type Resources struct {
140-
// DisableOOMKiller disables the OOM killer for out of memory conditions.
147+
// DisableOOMKiller disables the OOM killer for out of memory conditions
141148
DisableOOMKiller bool `json:"disableOOMKiller"`
142-
// Memory restriction configuration.
149+
// Memory restriction configuration
143150
Memory Memory `json:"memory"`
144-
// CPU resource restriction configuration.
151+
// CPU resource restriction configuration
145152
CPU CPU `json:"cpu"`
146-
// BlockIO restriction configuration.
153+
// BlockIO restriction configuration
147154
BlockIO BlockIO `json:"blockIO"`
148155
// Hugetlb limit (in bytes)
149156
HugepageLimits []HugepageLimit `json:"hugepageLimits"`
150-
// Network restriction configuration.
157+
// Network restriction configuration
151158
Network Network `json:"network"`
152159
}

0 commit comments

Comments
 (0)