Process stop detection
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-05-26 15:25:36 +02:00
parent 2b5e0a0c6c
commit 552db9de87

View File

@@ -196,7 +196,8 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
// to initially connect. So we just wait a fixed amount of time and check for process exit.
time.Sleep(1 * time.Second)
log.WithFields(log.Fields{"name": r.Name}).Info("Process started")
if cmd.ProcessState.Exited() {
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")
return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' exist status: %v", r.Name, cmd.ProcessState.ExitCode())
}