Mounting always hangs response.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-26 13:48:53 +02:00
parent 550e241163
commit 56b95c0604

View File

@@ -184,10 +184,14 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
for scanner.Scan() {
log.WithFields(log.Fields{"name": r.Name}).Info(scanner.Text())
}
log.WithFields(log.Fields{"name": r.Name}).Info("Completing mount process")
cmd.Wait()
log.WithFields(log.Fields{"name": r.Name}).Info("Completed mount process")
}()
if err := cmd.Start(); err != nil {
return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' error: %s", r.Name, err.Error())
}
log.WithFields(log.Fields{"name": r.Name}).Info("Process started")
// The drawback of running the mount in the foreground is there is no way to tell if it failed
// to initially connect. So we just wait a fixed amount of time and check for process exit.
@@ -196,6 +200,7 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' exist status: %v", r.Name, cmd.ProcessState.ExitCode())
}
log.WithFields(log.Fields{"name": r.Name}).Info("Volume mounted")
v.mounted = true
}
v.use[r.ID] = true