Skip to content

Commit eb48ef2

Browse files
committed
proto: changes per style guide
Signed-off-by: Vincent Batts <[email protected]>
1 parent c68fac1 commit eb48ef2

File tree

2 files changed

+84
-84
lines changed

2 files changed

+84
-84
lines changed

proto/runtime_config.proto

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ message RuntimeSpec {
88
// Mounts is a mapping of names to mount configurations.
99
// Which mounts will be mounted and where should be chosen with MountPoints
1010
// in Spec.
11-
repeated MountFieldEntry Mounts = 1;
11+
repeated MountFieldEntry mounts = 1;
1212
// Hooks are the commands run at various lifecycle events of the container.
13-
optional Hooks Hooks = 2;
13+
optional Hooks hooks = 2;
1414
}
1515

1616
// LinuxRuntimeSpec is the full specification for linux containers.
1717
message LinuxRuntimeSpec {
18-
optional RuntimeSpec RuntimeSpec = 1;
18+
optional RuntimeSpec runtime_spec = 1;
1919
// LinuxRuntime is platform specific configuration for linux based containers.
20-
optional oci.LinuxRuntime Linux = 2;
20+
optional oci.LinuxRuntime linux = 2;
2121
}
2222

2323
// MountFieldEntry is more backwards compatible protobuf associative map (than map<string, Mount>)
@@ -29,26 +29,26 @@ message MountFieldEntry {
2929
// Mount specifies a mount for a container
3030
message Mount {
3131
// Type specifies the mount kind.
32-
optional string Type = 1;
32+
optional string type = 1;
3333
// Source specifies the source path of the mount. In the case of bind mounts on
3434
// linux based systems this would be the file on the host.
35-
optional string Source = 2;
35+
optional string source = 2;
3636
// Options are fstab style mount options.
37-
repeated string Options = 3;
37+
repeated string options = 3;
3838
}
3939

4040
// Hook specifies a command that is run at a particular event in the lifecycle of a container
4141
message Hook {
42-
optional string Path = 1;
43-
repeated string Args = 2;
44-
repeated string Env = 3;
42+
optional string path = 1;
43+
repeated string args = 2;
44+
repeated string env = 3;
4545
}
4646

4747
// Hooks for container setup and teardown
4848
message Hooks {
4949
// Prestart is a list of hooks to be run before the container process is executed.
5050
// On Linux, they are run after the container namespaces are created.
51-
repeated Hook Prestart = 1;
51+
repeated Hook prestart = 1;
5252
// Poststop is a list of hooks to be run after the container process exits.
53-
repeated Hook Poststop = 2;
53+
repeated Hook poststop = 2;
5454
}

proto/runtime_config_linux.proto

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,58 @@ package oci;
33
// LinuxStateDirectory holds the container's state information
44
message DefaultState {
55
// TODO(vbatts) not as elegant in some ways, but there is not a concept of const here
6-
optional string Directory = 1 [default = "/run/opencontainer/containers"];
6+
optional string directory = 1 [default = "/run/opencontainer/containers"];
77
}
88

99
// LinuxRuntime hosts the Linux-only runtime information
1010
message LinuxRuntime {
11-
// UIDMapping specifies user mappings for supporting user namespaces on linux.
12-
repeated IDMapping UIDMapping = 1;
13-
// GIDMapping specifies group mappings for supporting user namespaces on linux.
14-
repeated IDMapping GIDMapping = 2;
11+
// UidMapping specifies user mappings for supporting user namespaces on linux.
12+
repeated IDMapping uid_mapping = 1;
13+
// GidMapping specifies group mappings for supporting user namespaces on linux.
14+
repeated IDMapping gid_mapping = 2;
1515
// Rlimits specifies rlimit options to apply to the container's process.
16-
repeated Rlimit Rlimits = 3;
16+
repeated Rlimit rlimits = 3;
1717
// Sysctl are a set of key value pairs that are set for the container on start
18-
repeated StringStringEntry Sysctl = 4;
18+
repeated StringStringEntry sysctl = 4;
1919
// Resources contain cgroup information for handling resource constraints
2020
// for the container
21-
optional Resources Resources = 5;
21+
optional Resources resources = 5;
2222
// CgroupsPath specifies the path to cgroups that are created and/or joined by the container.
2323
// The path is expected to be relative to the cgroups mountpoint.
2424
// If resources are specified, the cgroups at CgroupsPath will be updated based on resources.
25-
optional string CgroupsPath = 6;
25+
optional string cgroups_path = 6;
2626
// Namespaces contains the namespaces that are created and/or joined by the container
27-
repeated Namespace Namespaces = 7;
27+
repeated Namespace namespaces = 7;
2828
// Devices are a list of device nodes that are created and enabled for the container
29-
repeated Device Devices = 8;
29+
repeated Device devices = 8;
3030
// ApparmorProfile specified the apparmor profile for the container.
31-
optional string ApparmorProfile = 9;
31+
optional string apparmor_profile = 9;
3232
// SelinuxProcessLabel specifies the selinux context that the container process is run as.
33-
optional string SelinuxProcessLabel = 10;
33+
optional string selinux_process_label = 10;
3434
// Seccomp specifies the seccomp security settings for the container.
35-
optional Seccomp Seccomp = 11;
35+
optional Seccomp seccomp = 11;
3636
// RootfsPropagation is the rootfs mount propagation mode for the container
37-
optional string RootfsPropagation = 12;
37+
optional string rootfs_propagation = 12;
3838
}
3939

4040
// IDMapping specifies UID/GID mappings
4141
message IDMapping {
4242
// HostID is the UID/GID of the host user or group
43-
optional int32 HostID = 1;
43+
optional int32 host_id = 1;
4444
// ContainerID is the UID/GID of the container's user or group
45-
optional int32 ContainerID = 2;
45+
optional int32 container_id = 2;
4646
// Size is the length of the range of IDs mapped between the two namespaces
47-
optional int32 Size = 3;
47+
optional int32 size = 3;
4848
}
4949

5050
// Rlimit type and restrictions
5151
message Rlimit {
5252
// Type of the rlimit to set
53-
optional string Type = 1;
53+
optional string type = 1;
5454
// Hard is the hard limit for the specified type
55-
optional uint64 Hard = 2;
55+
optional uint64 hard = 2;
5656
// Soft is the soft limit for the specified type
57-
optional uint64 Soft = 3;
57+
optional uint64 soft = 3;
5858
}
5959

6060
// StringStringEntry is more backwards compatible protobuf associative map (than map<string, Mount>)
@@ -66,148 +66,148 @@ message StringStringEntry {
6666
// Resources has container runtime resource constraints
6767
message Resources {
6868
// DisableOOMKiller disables the OOM killer for out of memory conditions
69-
optional bool DisableOOMKiller = 1;
69+
optional bool disable_oom_killer = 1;
7070
// Memory restriction configuration
71-
optional Memory Memory = 2;
71+
optional Memory memory = 2;
7272
// CPU resource restriction configuration
73-
optional CPU CPU = 3;
73+
optional CPU cpu = 3;
7474
// Task resource restriction configuration.
75-
optional Pids Pids = 4;
75+
optional Pids pids = 4;
7676
// BlockIO restriction configuration
77-
optional BlockIO BlockIO = 5;
77+
optional BlockIO block_io = 5;
7878
// Hugetlb limit (in bytes)
79-
repeated HugepageLimit HugepageLimits = 6;
79+
repeated HugepageLimit hugepage_limits = 6;
8080
// Network restriction configuration
81-
optional Network Network = 7;
81+
optional Network network = 7;
8282
}
8383

8484
// Memory for Linux cgroup 'memory' resource management
8585
message Memory {
8686
// Memory limit (in bytes)
87-
optional int64 Limit = 1;
87+
optional int64 limit = 1;
8888
// Memory reservation or soft_limit (in bytes)
89-
optional int64 Reservation = 2;
89+
optional int64 reservation = 2;
9090
// Total memory usage (memory + swap); set `-1' to disable swap
91-
optional int64 Swap = 3;
91+
optional int64 swap = 3;
9292
// Kernel memory limit (in bytes)
93-
optional int64 Kernel = 4;
93+
optional int64 kernel = 4;
9494
// How aggressive the kernel will swap memory pages. Range from 0 to 100. Set -1 to use system default
9595
optional int64 Swappiness = 5;
9696
}
9797

9898
// CPU for Linux cgroup 'cpu' resource management
9999
message CPU {
100100
// CPU shares (relative weight vs. other cgroups with cpu shares)
101-
optional int64 Shares = 1;
101+
optional int64 shares = 1;
102102
// CPU hardcap limit (in usecs). Allowed cpu time in a given period
103-
optional int64 Quota = 2;
103+
optional int64 quota = 2;
104104
// CPU period to be used for hardcapping (in usecs). 0 to use system default
105-
optional int64 Period = 3;
105+
optional int64 period = 3;
106106
// How many time CPU will use in realtime scheduling (in usecs)
107-
optional int64 RealtimeRuntime = 4;
107+
optional int64 realtime_runtime = 4;
108108
// CPU period to be used for realtime scheduling (in usecs)
109-
optional int64 RealtimePeriod = 5;
109+
optional int64 realtime_period = 5;
110110
// CPU to use within the cpuset
111-
optional string Cpus = 6;
111+
optional string cpus = 6;
112112
// MEM to use within the cpuset
113-
optional string Mems = 7;
113+
optional string mems = 7;
114114
}
115115

116116
// Pids for Linux cgroup 'pids' resource management (Linux 4.3)
117117
message Pids {
118118
// Maximum number of PIDs. A value < 0 implies "no limit".
119-
optional int64 Limit = 1;
119+
optional int64 limit = 1;
120120
}
121121

122122
// BlockIO for Linux cgroup 'blockio' resource management
123123
message BlockIO {
124124
// Specifies per cgroup weight, range is from 10 to 1000
125-
optional int64 Weight = 1;
125+
optional int64 weight = 1;
126126
// Weight per cgroup per device, can override BlkioWeight
127-
optional string WeightDevice = 2;
127+
optional string weight_device = 2;
128128
// IO read rate limit per cgroup per device, bytes per second
129-
optional string ThrottleReadBpsDevice = 3;
129+
optional string throttle_read_bps_device = 3;
130130
// IO write rate limit per cgroup per divice, bytes per second
131-
optional string ThrottleWriteBpsDevice = 4;
131+
optional string throttle_write_bps_device = 4;
132132
// IO read rate limit per cgroup per device, IO per second
133-
optional string ThrottleReadIOpsDevice = 5;
133+
optional string throttle_read_iops_device = 5;
134134
// IO write rate limit per cgroup per device, IO per second
135-
optional string ThrottleWriteIOpsDevice = 6;
135+
optional string throttle_write_iops_device = 6;
136136
}
137137

138138
// HugepageLimit structure corresponds to limiting kernel hugepages
139139
message HugepageLimit {
140-
optional string Pagesize = 1;
141-
optional int32 Limit = 2;
140+
optional string pagesize = 1;
141+
optional int32 limit = 2;
142142
}
143143

144144
// Network identification and priority configuration
145145
message Network {
146146
// Set class identifier for container's network packets
147-
optional string ClassID = 1;
147+
optional string class_id = 1;
148148
// Set priority of network traffic for container
149-
repeated InterfacePriority Priorities = 2;
149+
repeated InterfacePriority priorities = 2;
150150
}
151151

152152
// InterfacePriority for network interfaces
153153
message InterfacePriority {
154154
// Name is the name of the network interface
155-
optional string Name = 1;
155+
optional string name = 1;
156156
// Priority for the interface
157-
optional int64 Priority = 2;
157+
optional int64 priority = 2;
158158
}
159159

160160
// Namespace is the configuration for a linux namespace
161161
message Namespace {
162162
// Type is the type of Linux namespace
163-
optional string Type = 1;
163+
optional string type = 1;
164164
// Path is a path to an existing namespace persisted on disk that can be joined
165165
// and is of the same type
166-
optional string Path = 2;
166+
optional string path = 2;
167167
}
168168

169169
// Device represents the information on a Linux special device file
170170
message Device {
171171
// Path to the device.
172-
optional string Path = 1;
172+
optional string path = 1;
173173
// Device type, block, char, etc.
174174
// TODO(vbatts) ensure int32 is fine here, instead of golang's rune
175-
optional int32 Type = 2;
175+
optional int32 type = 2;
176176
// Major is the device's major number.
177-
optional int64 Major = 3;
177+
optional int64 major = 3;
178178
// Minor is the device's minor number.
179-
optional int64 Minor = 4;
179+
optional int64 minor = 4;
180180
// Cgroup permissions format, rwm.
181-
optional string Permissions = 5;
181+
optional string permissions = 5;
182182
// FileMode permission bits for the device.
183183
// TODO(vbatts) os.FileMode is an octal uint32
184-
optional uint32 FileMode = 6;
185-
// UID of the device.
186-
optional uint32 UID = 7;
184+
optional uint32 file_mode = 6;
185+
// Uid of the device.
186+
optional uint32 uid = 7;
187187
// Gid of the device.
188-
optional uint32 GID = 8;
188+
optional uint32 gid = 8;
189189
}
190190

191191
// Seccomp represents syscall restrictions
192192
message Seccomp {
193193
// TODO(vbatts) string instead of "Action" type
194-
optional string DefaultAction = 1;
195-
repeated Syscall Syscalls = 2;
194+
optional string default_action = 1;
195+
repeated Syscall syscalls = 2;
196196
}
197197

198198
// Syscall is used to match a syscall in Seccomp
199199
message Syscall {
200-
optional string Name = 1;
201-
optional string Action = 2;
202-
repeated Arg Args = 3;
200+
optional string name = 1;
201+
optional string action = 2;
202+
repeated Arg args = 3;
203203
}
204204

205205
// Arg used for matching specific syscall arguments in Seccomp
206206
message Arg {
207-
optional uint32 Index = 1;
208-
optional uint64 Value = 2;
209-
optional uint64 ValueTwo = 3;
207+
optional uint32 index = 1;
208+
optional uint64 value = 2;
209+
optional uint64 value_two = 3;
210210
// Op is the operator string
211-
optional string Op = 4;
211+
optional string op = 4;
212212
}
213213

0 commit comments

Comments
 (0)