diff --git a/main.go b/main.go index ae7ef33..3c909aa 100644 --- a/main.go +++ b/main.go @@ -163,8 +163,16 @@ func (d ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) if err := os.MkdirAll(v.volume.Mountpoint, 0755); err != nil { return &volume.MountResponse{}, err } + + var opts string + if len(v.opts) == 0 { + opts = "" + } else { + opts = "-o" + v.opts + } + // Note: The first argument ("mount") causes running in the foreground, its absence in the background - cmd := exec.Command("/sbin/mount.objectivefs", "mount", "-o"+v.opts, v.fs, v.volume.Mountpoint) + cmd := exec.Command("/sbin/mount.objectivefs", "mount", opts, v.fs, v.volume.Mountpoint) cmd.Env = v.env cmdReader, _ := cmd.StderrPipe() log.WithFields(log.Fields{