Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Commit

Permalink
Allow spaces in NFS shares
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
  • Loading branch information
jandubois committed Apr 29, 2021
1 parent ef068b1 commit b19cea9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/hyperkit/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ func (d *Driver) setupNFSShare() error {
mountPoint = sharePaths[1]
}
mountCommands += fmt.Sprintf("sudo mkdir -p %s\\n", mountPoint)
mountCommands += fmt.Sprintf("sudo mount -t nfs -o vers=3,noacl,async %s:%s %s\\n", hostIP, localPath, mountPoint)
mountCommands += fmt.Sprintf("sudo mount -t nfs -o vers=3,noacl,async '%s:%s' %s\\n", hostIP, localPath, mountPoint)
}

if _, err := self(exportsAddCmd...); err != nil {
Expand Down Expand Up @@ -633,7 +633,7 @@ func AddNFSExports(args ...string) error {
ip := args[2]
args = args[3:]

export := fmt.Sprintf("%s %s -alldirs -mapall=%s", path, ip, user)
export := fmt.Sprintf("%q %s -alldirs -mapall=%s", path, ip, user)
if _, err := nfsexports.Add("", ident, export); err != nil {
if strings.Contains(err.Error(), "conflicts with existing export") {
fmt.Fprintf(os.Stderr, "Conflicting NFS Share not setup and ignored: %v", err)
Expand Down

0 comments on commit b19cea9

Please sign in to comment.