diff --git a/validate/validate.go b/validate/validate.go index 1d71e6efa..67c6f1752 100644 --- a/validate/validate.go +++ b/validate/validate.go @@ -555,6 +555,23 @@ func (v *Validator) CheckLinuxResources() (msgs []string) { } } } + for index := 0; index < len(r.Devices); index++ { + switch r.Devices[index].Type { + case "a", "b", "c": + default: + msgs = append(msgs, fmt.Sprintf("type of devices %s is invalid", r.Devices[index].Type)) + } + + access := []byte(r.Devices[index].Access) + for i := 0; i < len(access); i++ { + switch access[i] { + case 'r', 'w', 'm': + default: + msgs = append(msgs, fmt.Sprintf("access %s is invalid", r.Devices[index].Access)) + return + } + } + } return }