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"
@@ -474,6 +475,26 @@ func (v *Validator) CheckLinuxResources() (msgs []string) {
474475 msgs = append (msgs , fmt .Sprintf ("Minimum memory limit should be larger than memory reservation" ))
475476 }
476477 }
478+ if r .Network != nil && v .HostSpecific {
479+ var exist bool
480+ interfaces , err := net .Interfaces ()
481+ if err != nil {
482+ msgs = append (msgs , err .Error ())
483+ return
484+ }
485+ for _ , prio := range r .Network .Priorities {
486+ exist = false
487+ for _ , ni := range interfaces {
488+ if prio .Name == ni .Name {
489+ exist = true
490+ break
491+ }
492+ }
493+ if ! exist {
494+ msgs = append (msgs , fmt .Sprintf ("Interface %s does not exist currently" , prio .Name ))
495+ }
496+ }
497+ }
477498
478499 return
479500}
You can’t perform that action at this time.
0 commit comments