File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ func (n nfsDriver) Mount(r volume.MountRequest) volume.Response {
7676 }
7777
7878 n .mountm .Add (resolvedName , hostdir )
79-
79+
8080 if err := n .mountVolume (resolvedName , source , hostdir , n .version ); err != nil {
8181 return volume.Response {Err : err .Error ()}
8282 }
@@ -121,14 +121,14 @@ func (n nfsDriver) Unmount(r volume.UnmountRequest) volume.Response {
121121
122122 n .mountm .DeleteIfNotManaged (resolvedName )
123123
124- // Check if directory is empty. This command will return "err" if empty
125- if err := run (fmt .Sprintf ("ls -1 %s | grep ." , hostdir )); err == nil {
126- log .Warnf ("Directory %s not empty after unmount. Skipping RemoveAll call." , hostdir )
127- } else {
128- if err := os .RemoveAll (hostdir ); err != nil {
129- return volume.Response {Err : err .Error ()}
124+ // Check if directory is empty. This command will return "err" if empty
125+ if err := run (fmt .Sprintf ("ls -1 %s | grep ." , hostdir )); err == nil {
126+ log .Warnf ("Directory %s not empty after unmount. Skipping RemoveAll call." , hostdir )
127+ } else {
128+ if err := os .RemoveAll (hostdir ); err != nil {
129+ return volume.Response {Err : err .Error ()}
130130 }
131- }
131+ }
132132
133133 return volume.Response {}
134134}
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ package netshare
22
33import (
44 "fmt"
5- "os"
6- "path/filepath"
7- "strconv"
85 "github.com/ContainX/docker-volume-netshare/netshare/drivers"
96 log "github.com/Sirupsen/logrus"
107 "github.com/docker/go-plugins-helpers/volume"
118 "github.com/spf13/cobra"
9+ "os"
10+ "path/filepath"
11+ "strconv"
1212 "syscall"
1313)
1414
You can’t perform that action at this time.
0 commit comments