diff --git a/driver/mounter.go b/driver/mounter.go index c9bcaae..44c5a5e 100644 --- a/driver/mounter.go +++ b/driver/mounter.go @@ -14,15 +14,13 @@ func Mount(source, target, fsType string, opts []string) error { cmd := "mount" var options []string options = append(options, "-o") - if len(opts) > 0 { - options = append(options, strings.Join(opts, ",")) - } - options = append(options, "bind") + opts = append(opts, "bind") + options = append(options, strings.Join(opts, ",")) options = append(options, source) options = append(options, target) glog.Infof("Executing mount command '%s %s'", cmd, strings.Join(options, " ")) if out, err := exec.Command(cmd, options...).CombinedOutput(); err != nil { - return fmt.Errorf("failed mount: %v cmd: '%s %s' command output: %q", err, cmd, target, string(out)) + return fmt.Errorf("failed mount: %v cmd: '%s %s %s' command output: %q", err, cmd, options, target, string(out)) } return nil }