File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -747,22 +747,6 @@ func (v *Validator) rlimitValid(rlimit rspec.POSIXRlimit) (errs error) {
747747 return
748748}
749749
750- func deviceValid (d rspec.LinuxDevice ) bool {
751- switch d .Type {
752- case "b" , "c" , "u" :
753- if d .Major <= 0 || d .Minor <= 0 {
754- return false
755- }
756- case "p" :
757- if d .Major != 0 || d .Minor != 0 {
758- return false
759- }
760- default :
761- return false
762- }
763- return true
764- }
765-
766750func isStruct (t reflect.Type ) bool {
767751 return t .Kind () == reflect .Struct
768752}
Original file line number Diff line number Diff line change @@ -30,6 +30,22 @@ func LastCap() capability.Cap {
3030 return last
3131}
3232
33+ func deviceValid (d rspec.LinuxDevice ) bool {
34+ switch d .Type {
35+ case "b" , "c" , "u" :
36+ if d .Major <= 0 || d .Minor <= 0 {
37+ return false
38+ }
39+ case "p" :
40+ if d .Major != 0 || d .Minor != 0 {
41+ return false
42+ }
43+ default :
44+ return false
45+ }
46+ return true
47+ }
48+
3349// CheckLinux checks v.spec.Linux
3450func (v * Validator ) CheckLinux () (errs error ) {
3551 logrus .Debugf ("check linux" )
You can’t perform that action at this time.
0 commit comments