Skip to content

Commit 2a46895

Browse files
committed
validate: allow unset "type" fields in resource devices whitelist
According to the spec, an unset .Type field in the .Linux.Resources.Devices list is permitted (and it maps to "all"). This was broken recently, making our own default profile (as well as umoci's and runc's) not pass validation anymore. Signed-off-by: Aleksa Sarai <asarai@suse.de>
1 parent e2707b1 commit 2a46895

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

validate/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ func (v *Validator) CheckLinuxResources() (errs error) {
749749
}
750750
for index := 0; index < len(r.Devices); index++ {
751751
switch r.Devices[index].Type {
752-
case "a", "b", "c":
752+
case "a", "b", "c", "":
753753
default:
754754
errs = multierror.Append(errs, fmt.Errorf("type of devices %s is invalid", r.Devices[index].Type))
755755
}

0 commit comments

Comments
 (0)