From 56b95c06049658a74eef4583aa0a34af82ccb912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Van=C3=AD=C4=8Dek?= Date: Fri, 26 May 2023 13:48:53 +0200 Subject: [PATCH] Mounting always hangs response. --- main.go | 5 +++++ 1 file changed, 5 insertions(+) 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