Skip to content

Commit d045a21

Browse files
wkingMa Shimiao
authored andcommitted
runtime-config-linux: Convert classID from hex to uint32
The just-landed style conventions prefer integers to hex strings [1], and I said I'd post an update for this setting if/when those landed [2]. The kernel uses uint32s for this setting [3]. [1]: opencontainers#287 [2]: opencontainers#287 (comment) [3]: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/net/cls_cgroup.h?id=refs/tags/v4.3#n24 Signed-off-by: W. Trevor King <[email protected]>
1 parent 86e23fd commit d045a21

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

runtime-config-linux.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ For more information, see [the net\_cls cgroup man page](https://www.kernel.org/
378378

379379
The following parameters can be specified to setup these cgroup controllers:
380380

381-
* **`classID`** *(string, optional)* - is the network class identifier the cgroup's network packets will be tagged with
381+
* **`classID`** *(uint32, optional)* - is the network class identifier the cgroup's network packets will be tagged with
382382

383383
* **`priorities`** *(array, optional)* - specifies a list of objects of the priorities assigned to traffic originating from
384384
processes in the group and egressing the system on various interfaces. The following parameters can be specified per-priority:
@@ -389,7 +389,7 @@ processes in the group and egressing the system on various interfaces. The follo
389389

390390
```json
391391
"network": {
392-
"classID": "0x100001",
392+
"classID": 1048577,
393393
"priorities": [
394394
{
395395
"name": "eth0",

runtime_config_linux.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ type Pids struct {
191191
// Network identification and priority configuration
192192
type Network struct {
193193
// Set class identifier for container's network packets
194-
// this is actually a string instead of a uint64 to overcome the json
195-
// limitation of specifying hex numbers
196-
ClassID string `json:"classID"`
194+
ClassID *uint32 `json:"classID"`
197195
// Set priority of network traffic for container
198196
Priorities []InterfacePriority `json:"priorities"`
199197
}

0 commit comments

Comments
 (0)