Skip to content

Commit 6930b11

Browse files
authored
Merge pull request #253 from andyzhangx/mount-utils
chore: switch to use k8s.io/mount-utils
2 parents 2fd1672 + f7bc14c commit 6930b11

21 files changed

+17
-1933
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ require (
2525
k8s.io/client-go v0.20.0
2626
k8s.io/klog/v2 v2.4.0
2727
k8s.io/kubernetes v1.21.0-alpha.0.0.20201210005053-f58c4d8cd725
28+
k8s.io/mount-utils v0.0.0
2829
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
2930
sigs.k8s.io/yaml v1.2.0
3031
)

pkg/mounter/safe_mounter_unix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ limitations under the License.
1919
package mounter
2020

2121
import (
22+
mount "k8s.io/mount-utils"
2223
utilexec "k8s.io/utils/exec"
23-
"k8s.io/utils/mount"
2424
)
2525

2626
func NewSafeMounter() (*mount.SafeFormatAndMount, error) {

pkg/mounter/safe_mounter_windows.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import (
3232
smbclient "github.com/kubernetes-csi/csi-proxy/client/groups/smb/v1beta1"
3333

3434
"k8s.io/klog/v2"
35+
mount "k8s.io/mount-utils"
3536
utilexec "k8s.io/utils/exec"
36-
"k8s.io/utils/mount"
3737
)
3838

3939
var _ mount.Interface = &CSIProxyMounter{}
@@ -237,6 +237,10 @@ func (mounter *CSIProxyMounter) MountSensitive(source string, target string, fst
237237
return fmt.Errorf("MountSensitive not implemented for CSIProxyMounter")
238238
}
239239

240+
func (mounter *CSIProxyMounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
241+
return fmt.Errorf("MountSensitiveWithoutSystemd not implemented for CSIProxyMounter")
242+
}
243+
240244
// NewCSIProxyMounter - creates a new CSI Proxy mounter struct which encompassed all the
241245
// clients to the CSI proxy - filesystem, disk and volume clients.
242246
func NewCSIProxyMounter() (*CSIProxyMounter, error) {

pkg/smb/fake_mounter.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ package smb
1818

1919
import (
2020
"fmt"
21-
"github.com/kubernetes-csi/csi-driver-smb/pkg/mounter"
2221
"runtime"
2322
"strings"
2423

25-
"k8s.io/utils/mount"
24+
"github.com/kubernetes-csi/csi-driver-smb/pkg/mounter"
25+
26+
mount "k8s.io/mount-utils"
2627
)
2728

2829
type fakeMounter struct {

pkg/smb/fake_mounter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"reflect"
2222
"testing"
2323

24-
"k8s.io/utils/mount"
24+
mount "k8s.io/mount-utils"
2525
)
2626

2727
func TestMount(t *testing.T) {

pkg/smb/nodeserver_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/stretchr/testify/assert"
3434
"google.golang.org/grpc/codes"
3535
"google.golang.org/grpc/status"
36-
"k8s.io/utils/mount"
36+
mount "k8s.io/mount-utils"
3737
)
3838

3939
func matchFlakyWindowsError(mainError error, substr string) bool {

pkg/smb/smb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/container-storage-interface/spec/lib/go/csi"
2323

2424
"k8s.io/klog/v2"
25-
"k8s.io/utils/mount"
25+
mount "k8s.io/mount-utils"
2626

2727
csicommon "github.com/kubernetes-csi/csi-driver-smb/pkg/csi-common"
2828
"github.com/kubernetes-csi/csi-driver-smb/pkg/mounter"

pkg/smb/smb_common_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package smb
2121
import (
2222
"os"
2323

24-
"k8s.io/utils/mount"
24+
mount "k8s.io/mount-utils"
2525
)
2626

2727
func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options []string, sensitiveMountOptions []string) error {

pkg/smb/smb_common_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package smb
2121
import (
2222
"os"
2323

24-
"k8s.io/utils/mount"
24+
mount "k8s.io/mount-utils"
2525
)
2626

2727
func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, options, sensitiveMountOptions []string) error {

pkg/smb/smb_common_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/kubernetes-csi/csi-driver-smb/pkg/mounter"
2626
"k8s.io/klog/v2"
27-
"k8s.io/utils/mount"
27+
mount "k8s.io/mount-utils"
2828
)
2929

3030
func Mount(m *mount.SafeFormatAndMount, source, target, fsType string, mountOptions, sensitiveMountOptions []string) error {

vendor/k8s.io/utils/mount/OWNERS

-15
This file was deleted.

vendor/k8s.io/utils/mount/doc.go

-18
This file was deleted.

vendor/k8s.io/utils/mount/fake_mounter.go

-216
This file was deleted.

0 commit comments

Comments
 (0)