diff --git a/main.go b/main.go index 6725f4e..fe27d49 100644 --- a/main.go +++ b/main.go @@ -406,9 +406,11 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) } // Check for mount - if isObjfs, err := isObjectiveFsMount(mountPath); err == nil && isObjfs { - break - } + time.Sleep(1000 * time.Millisecond) + break + //if isObjfs, err := isObjectiveFsMount(mountPath); err == nil && isObjfs { + // break + //} } log.WithFields(log.Fields{"name": r.Name}).Info("Volume mounted") @@ -814,13 +816,12 @@ func getMountedSnaphots(baseDir string, checkMount bool) (map[string]string, err } func isObjectiveFsMount(path string) (bool, error) { - nameToMatch := filepath.Base(path) mount := exec.Command("df", "--output=target", "-t", "fuse.objectivefs", path) if data, err := mount.CombinedOutput(); err == nil { 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() && filepath.Base(strings.TrimSpace(scanner.Text())) == nameToMatch, nil + return scanner.Scan() && scanner.Scan() && strings.TrimSpace(scanner.Text()) == path, nil } else { return false, err }