Skip to content

Commit bc42fb6

Browse files
committed
test: fix ut on windows and darwin
1 parent ba1f1ac commit bc42fb6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/nfs/nfs.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package nfs
1818

1919
import (
20+
"runtime"
2021
"strings"
2122

2223
"github.com/container-storage-interface/spec/lib/go/csi"
@@ -108,7 +109,12 @@ func (n *Driver) Run(testMode bool) {
108109
}
109110
klog.V(2).Infof("\nDRIVER INFORMATION:\n-------------------\n%s\n\nStreaming logs below:", versionMeta)
110111

111-
n.ns = NewNodeServer(n, mount.New("").(mount.MounterForceUnmounter))
112+
mounter := mount.New("")
113+
if runtime.GOOS == "linux" {
114+
// MounterForceUnmounter is only implemented on Linux now
115+
mounter = mounter.(mount.MounterForceUnmounter)
116+
}
117+
n.ns = NewNodeServer(n, mounter)
112118
s := NewNonBlockingGRPCServer()
113119
s.Start(n.endpoint,
114120
NewDefaultIdentityServer(n),

0 commit comments

Comments
 (0)