Skip to content

Commit de08605

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 <[email protected]>
1 parent 6554add commit de08605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)