Skip to content

Commit

Permalink
validate: add the validation of devices.type
Browse files Browse the repository at this point in the history
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
  • Loading branch information
zhouhao committed Apr 28, 2017
1 parent 8addcc6 commit 02e86dd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,14 @@ 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))
}

}

return
}
Expand Down

0 comments on commit 02e86dd

Please sign in to comment.