File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 55 "encoding/json"
66 "fmt"
77 "io/ioutil"
8+ "net"
89 "os"
910 "path/filepath"
1011 "reflect"
@@ -411,6 +412,26 @@ func (v *Validator) CheckLinuxResources() (msgs []string) {
411412 msgs = append (msgs , fmt .Sprintf ("Minimum memory limit should be larger than memory reservation" ))
412413 }
413414 }
415+ if r .Network != nil && v .HostSpecific {
416+ var exist bool
417+ interfaces , err := net .Interfaces ()
418+ if err != nil {
419+ msgs = append (msgs , err .Error ())
420+ return
421+ }
422+ for _ , prio := range r .Network .Priorities {
423+ exist = false
424+ for _ , ni := range interfaces {
425+ if prio .Name == ni .Name {
426+ exist = true
427+ break
428+ }
429+ }
430+ if ! exist {
431+ msgs = append (msgs , fmt .Sprintf ("Interface %s does not exist on host" , prio .Name ))
432+ }
433+ }
434+ }
414435
415436 return
416437}
You can’t perform that action at this time.
0 commit comments