Skip to content

Commit 054d2df

Browse files
committed
config-linux: Make linux.resources.devices explicitly optional
And mark it omitempty to avoid: $ ocitools generate --template <(echo '{"linux": {"resources": {}}}') | jq .linux { "resources": { "devices": null } } Signed-off-by: W. Trevor King <[email protected]>
1 parent 60fff3f commit 054d2df

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ However, a runtime MAY attach the container process to additional cgroup control
198198

199199
#### Device whitelist
200200

201-
`devices` is an array of entries to control the [device whitelist][cgroup-v1-devices].
201+
**`devices`** (array, optional) configures the [device whitelist][cgroup-v1-devices].
202202
The runtime MUST apply entries in the listed order.
203203

204204
The following parameters can be specified:

specs-go/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ type Network struct {
301301

302302
// Resources has container runtime resource constraints
303303
type Resources struct {
304-
// Devices are a list of device rules for the whitelist controller
305-
Devices []DeviceCgroup `json:"devices"`
304+
// Devices configures the device whitelist.
305+
Devices []DeviceCgroup `json:"devices,omitempty"`
306306
// DisableOOMKiller disables the OOM killer for out of memory conditions
307307
DisableOOMKiller *bool `json:"disableOOMKiller,omitempty"`
308308
// Specify an oom_score_adj for the container.

0 commit comments

Comments
 (0)