diff --git a/main.go b/main.go index 4a26796..b34bc67 100644 --- a/main.go +++ b/main.go @@ -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