Skip to content

Commit a7a9137

Browse files
author
zhouhao
committed
validate: add the validation of devices.type
Signed-off-by: zhouhao <[email protected]>
1 parent 8addcc6 commit a7a9137

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

validate/validate.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,14 @@ func (v *Validator) CheckLinuxResources() (msgs []string) {
555555
}
556556
}
557557
}
558+
for index := 0; index < len(r.Devices); index++ {
559+
switch r.Devices[index].Type {
560+
case "a", "b", "c":
561+
default:
562+
msgs =append(msgs, fmt.Sprintf("type of devices %s is invalid", r.Devices[index].Type))
563+
}
564+
}
565+
558566

559567
return
560568
}

0 commit comments

Comments
 (0)