Skip to content

Commit 28cc423

Browse files
committed
add omitempty to 'Device' and 'Namespace'
Signed-off-by: liangchenye <[email protected]>
1 parent dfd71f7 commit 28cc423

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

config.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ Here is a full example `config.json` for reference.
404404
{
405405
"type": "mount"
406406
}
407-
],
408-
"devices": null,
409-
"seccomp": {
410-
"defaultAction": "",
411-
"architectures": null
412-
}
407+
]
413408
}
414409
}
415410
```

specs-go/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ type Linux struct {
128128
// If resources are specified, the cgroups at CgroupsPath will be updated based on resources.
129129
CgroupsPath *string `json:"cgroupsPath,omitempty"`
130130
// Namespaces contains the namespaces that are created and/or joined by the container
131-
Namespaces []Namespace `json:"namespaces"`
131+
Namespaces []Namespace `json:"namespaces,omitempty"`
132132
// Devices are a list of device nodes that are created for the container
133-
Devices []Device `json:"devices"`
133+
Devices []Device `json:"devices,omitempty"`
134134
// Seccomp specifies the seccomp security settings for the container.
135135
Seccomp *Seccomp `json:"seccomp,omitempty"`
136136
// RootfsPropagation is the rootfs mount propagation mode for the container.

0 commit comments

Comments
 (0)