Skip to content

Commit

Permalink
runtime-config-linux: Convert classID from hex to uint32
Browse files Browse the repository at this point in the history
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 <wking@tremily.us>
  • Loading branch information
wking authored and Ma Shimiao committed Aug 18, 2016
1 parent 86e23fd commit d045a21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions runtime-config-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ For more information, see [the net\_cls cgroup man page](https://www.kernel.org/

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

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

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

```json
"network": {
"classID": "0x100001",
"classID": 1048577,
"priorities": [
{
"name": "eth0",
Expand Down
4 changes: 1 addition & 3 deletions runtime_config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,7 @@ type Pids struct {
// Network identification and priority configuration
type Network struct {
// Set class identifier for container's network packets
// this is actually a string instead of a uint64 to overcome the json
// limitation of specifying hex numbers
ClassID string `json:"classID"`
ClassID *uint32 `json:"classID"`
// Set priority of network traffic for container
Priorities []InterfacePriority `json:"priorities"`
}
Expand Down

0 comments on commit d045a21

Please sign in to comment.