File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -337,11 +337,31 @@ func (v *Validator) CheckRlimits() (msgs []string) {
337337func supportedMountTypes (OS string , hostSpecific bool ) (map [string ]bool , error ) {
338338 supportedTypes := make (map [string ]bool )
339339
340- if OS != "linux" && OS != "windows " {
340+ if OS != "linux" && OS != "solaris " {
341341 logrus .Warnf ("%v is not supported to check mount type" , OS )
342342 return nil , nil
343- } else if OS == "windows" {
344- supportedTypes ["ntfs" ] = true
343+ } else if OS == "solaris" {
344+ f , err := os .Open ("/etc/vfstab" )
345+ if err != nil {
346+ return nil , err
347+ }
348+ defer f .Close ()
349+
350+ s := bufio .NewScanner (f )
351+ for s .Scan () {
352+ if err := s .Err (); err != nil {
353+ return supportedTypes , err
354+ }
355+
356+ text := s .Text ()
357+ parts := strings .Split (text , "\t " )
358+ if len (parts ) > 1 {
359+ supportedTypes [parts [1 ]] = true
360+ } else {
361+ supportedTypes [parts [0 ]] = true
362+ }
363+ }
364+
345365 return supportedTypes , nil
346366 }
347367
You can’t perform that action at this time.
0 commit comments