diff --git a/main.go b/main.go index 4613021..fc09213 100644 --- a/main.go +++ b/main.go @@ -402,7 +402,7 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) // success. for { // Check for process exit - time.Sleep(100 * time.Millisecond) + time.Sleep(10000 * time.Millisecond) if cmd.ProcessState != nil { // The process has exited so consider an error occured log.WithFields(log.Fields{"name": r.Name, "exitStatus": cmd.ProcessState.ExitCode()}).Error("Volume mount failed") @@ -823,8 +823,19 @@ func isObjectiveFsMount(path string) (bool, error) { scanner := bufio.NewScanner(strings.NewReader(string(data))) // On success the first line contains column headers (in our case "Mounted on") // and the second line contains the nearest mount point on the root path - return scanner.Scan() && scanner.Scan() && strings.TrimSpace(scanner.Text()) == path, nil + //return scanner.Scan() && scanner.Scan() && strings.TrimSpace(scanner.Text()) == path, nil + isOk := scanner.Scan() + isOk = isOk && scanner.Scan() + if isOk { + line := strings.TrimSpace(scanner.Text()) + log.WithFields(log.Fields{"mountInfo": line, "path": path, "matches": line == path}).Info("isObjectiveFsMount") + return line == path, nil + } else { + log.WithFields(log.Fields{"path": path, "matches": false}).Info("isObjectiveFsMount") + return false, nil + } } else { + log.WithFields(log.Fields{"path": path}).Info("isObjectiveFsMount") return false, err } }