diff --git a/pkg/smb/nodeserver.go b/pkg/smb/nodeserver.go index de9367bd1..d7d81c0ae 100644 --- a/pkg/smb/nodeserver.go +++ b/pkg/smb/nodeserver.go @@ -185,7 +185,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe } mountComplete := false err = wait.Poll(5*time.Second, 10*time.Minute, func() (bool, error) { - err := Mount(d.mounter, source, targetPath, "cifs", mountOptions) + err := SMBMount(d.mounter, source, targetPath, "cifs", mountOptions) mountComplete = true return true, err }) diff --git a/pkg/smb/smb_common_linux.go b/pkg/smb/smb_common_linux.go index 46252c4ec..5ef29f79e 100644 --- a/pkg/smb/smb_common_linux.go +++ b/pkg/smb/smb_common_linux.go @@ -24,11 +24,11 @@ import ( "k8s.io/utils/mount" ) -func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error { +func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error { return m.Mount(source, target, fsType, options) } -func Unmount(m *mount.SafeFormatAndMount, target string) error { +func SMBUnmount(m *mount.SafeFormatAndMount, target string) error { return m.Unmount(target) } diff --git a/pkg/smb/smb_common_windows.go b/pkg/smb/smb_common_windows.go index 66bb73ce6..c3f8c6e68 100644 --- a/pkg/smb/smb_common_windows.go +++ b/pkg/smb/smb_common_windows.go @@ -21,26 +21,25 @@ package smb import ( "fmt" + "github.com/kubernetes-csi/csi-driver-smb/pkg/mounter" "k8s.io/klog" "k8s.io/utils/mount" - - "github.com/kubernetes-csi/csi-driver-smb/pkg/mounter" ) -func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error { +func SMBMount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string) error { proxy, ok := m.Interface.(*mounter.CSIProxyMounter) if !ok { return fmt.Errorf("could not cast to csi proxy class") } - return proxy.Mount(source, target, fsType, options) + return proxy.SMBMount(source, target, fsType, options) } -func Unmount(m *mount.SafeFormatAndMount, target string) error { +func SMBUnmount(m *mount.SafeFormatAndMount, target string) error { proxy, ok := m.Interface.(*mounter.CSIProxyMounter) if !ok { return fmt.Errorf("could not cast to csi proxy class") } - return proxy.Unmount(target) + return proxy.SMBUnmount(target) } func RemoveStageTarget(m *mount.SafeFormatAndMount, target string) error { @@ -55,7 +54,7 @@ func RemoveStageTarget(m *mount.SafeFormatAndMount, target string) error { // The clean up mount point point calls is supposed for fix the corrupted directories as well. // For alpha CSI proxy integration, we only do an unmount. func CleanupSMBMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error { - return Unmount(m, target) + return SMBUnmount(m, target) } func CleanupMountPoint(m *mount.SafeFormatAndMount, target string, extensiveMountCheck bool) error {