Skip to content

Commit 01cf957

Browse files
authored
Merge pull request #1274 from huww98/bump-mount-utils
bump k8s.io/mount-utils to v0.30.8
2 parents 8ea6907 + ccabfa1 commit 01cf957

37 files changed

+1617
-231
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ require (
3737
k8s.io/component-base v0.26.12
3838
k8s.io/klog/v2 v2.120.1
3939
k8s.io/kubelet v0.26.12
40-
k8s.io/mount-utils v0.21.1
40+
k8s.io/mount-utils v0.30.8
4141
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
4242
)
4343

@@ -71,6 +71,7 @@ require (
7171
github.com/josharian/intern v1.0.0 // indirect
7272
github.com/json-iterator/go v1.1.12 // indirect
7373
github.com/mailru/easyjson v0.7.7 // indirect
74+
github.com/moby/sys/mountinfo v0.6.2 // indirect
7475
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
7576
github.com/modern-go/reflect2 v1.0.2 // indirect
7677
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect

go.sum

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
9898
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
9999
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
100100
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
101-
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
102101
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
103102
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
104103
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
@@ -214,6 +213,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
214213
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
215214
github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g=
216215
github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
216+
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
217+
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
217218
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
218219
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
219220
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -289,7 +290,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
289290
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
290291
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
291292
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
292-
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
293293
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
294294
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
295295
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
@@ -532,19 +532,16 @@ k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
532532
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
533533
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
534534
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
535-
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
536-
k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
537535
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
538536
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
539537
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
540538
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
541539
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
542540
k8s.io/kubelet v0.26.12 h1:iCdPbyAKPW0LmNdayPlfOA612j+zXwVlFaq5F3kNOr0=
543541
k8s.io/kubelet v0.26.12/go.mod h1:E3XxJLPzMQT1EcrJAVrl5rVd2Fh68DkMVpIvtWe5a3U=
544-
k8s.io/mount-utils v0.21.1 h1:uYf6zlKaaoUcPhWn6MElLkWf/f7UQgtkPZteumgwDbA=
545-
k8s.io/mount-utils v0.21.1/go.mod h1:dwXbIPxKtTjrBEaX1aK/CMEf1KZ8GzMHpe3NEBfdFXI=
542+
k8s.io/mount-utils v0.30.8 h1:7fsKmKZAc7nklpHuwknmWgaE/WEY6dnDlAuyGZFN/9Y=
543+
k8s.io/mount-utils v0.30.8/go.mod h1:9sCVmwGLcV1MPvbZ+rToMDnl1QcGozy+jBPd0MsQLIo=
546544
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
547-
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
548545
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
549546
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
550547
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

pkg/disk/nodeserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func NewNodeServer(m metadata.MetadataProvider) csi.NodeServer {
220220
metadata: m,
221221
mounter: utils.NewMounter(),
222222
kataBMIOType: kataBMIOType,
223-
k8smounter: k8smount.New(""),
223+
k8smounter: k8smount.NewWithoutSystemd(""),
224224
podCGroup: podCgroup,
225225
clientSet: GlobalConfigVar.ClientSet,
226226
ad: DiskAttachDetach{

pkg/ens/nodeserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func NewNodeServer() csi.NodeServer {
8282
MaxVolumePerNode: maxVolumesNum,
8383
mounter: utils.NewMounter(),
8484
podCgroup: podCgroup,
85-
k8smounter: k8smount.New(""),
85+
k8smounter: k8smount.NewWithoutSystemd(""),
8686
GenericNodeServer: common.GenericNodeServer{
8787
NodeID: GlobalConfigVar.InstanceID,
8888
},

pkg/metric/disk_stat_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func NewDiskStatCollector() (Collector, error) {
240240
milliSecondsLatencyThreshold: getDiskLatencyThreshold(),
241241
capacityPercentageThreshold: getDiskCapacityThreshold(),
242242
recorder: recorder,
243-
mounter: mount.New(""),
243+
mounter: mount.NewWithoutSystemd(""),
244244
nodeName: nodeName,
245245
}, nil
246246
}

pkg/metric/nfs_stat_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func NewNfsStatCollector() (Collector, error) {
244244
recorder: recorder,
245245
monitorClient: NewStorageMonitorClient(clientset),
246246
capacityPercentageThreshold: getNfsCapacityThreshold(),
247-
mounter: mount.New(""),
247+
mounter: mount.NewWithoutSystemd(""),
248248
}, nil
249249
}
250250

pkg/mounter/proxy/server/ossfs/mount_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type MountHandler struct {
3131
func NewMountHandler() *MountHandler {
3232
return &MountHandler{
3333
pids: new(sync.Map),
34-
raw: mount.New(""),
34+
raw: mount.NewWithoutSystemd(""),
3535
}
3636
}
3737

pkg/nas/mounter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ func (m *NasMounter) Mount(source string, target string, fstype string, options
3333
}
3434

3535
func newNasMounter() mountutils.Interface {
36-
inner := mountutils.New("")
36+
inner := mountutils.NewWithoutSystemd("")
3737
return &NasMounter{
3838
Interface: inner,
3939
alinasMounter: mounter.NewConnectorMounter(inner, ""),
4040
}
4141
}
4242

4343
func newNasMounterWithProxy(socketPath string) mountutils.Interface {
44-
inner := mountutils.New("")
44+
inner := mountutils.NewWithoutSystemd("")
4545
return &NasMounter{
4646
Interface: inner,
4747
alinasMounter: mounter.NewProxyMounter(socketPath, inner),

pkg/nas/mounter_test.go

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,19 @@ import (
88
mountutils "k8s.io/mount-utils"
99
)
1010

11-
type baseMockMounter struct{}
12-
13-
func (m baseMockMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
14-
return nil
15-
}
16-
17-
func (m baseMockMounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
18-
return nil
19-
}
20-
21-
func (m baseMockMounter) Unmount(target string) error {
22-
return nil
23-
}
24-
25-
func (m baseMockMounter) List() ([]mountutils.MountPoint, error) {
26-
return []mountutils.MountPoint{}, nil
27-
}
28-
29-
func (m baseMockMounter) IsLikelyNotMountPoint(file string) (bool, error) {
30-
return false, nil
31-
}
32-
33-
func (m baseMockMounter) GetMountRefs(pathname string) ([]string, error) {
34-
return []string{}, nil
35-
}
36-
3711
type successMockMounter struct {
38-
baseMockMounter
12+
mountutils.FakeMounter
3913
}
4014

41-
func (m successMockMounter) Mount(source string, target string, fstype string, options []string) error {
15+
func (m *successMockMounter) Mount(source string, target string, fstype string, options []string) error {
4216
return nil
4317
}
4418

4519
type errorMockMounter struct {
46-
baseMockMounter
20+
mountutils.FakeMounter
4721
}
4822

49-
func (m errorMockMounter) Mount(source string, target string, fstype string, options []string) error {
23+
func (m *errorMockMounter) Mount(source string, target string, fstype string, options []string) error {
5024
return errors.New("")
5125
}
5226

@@ -57,17 +31,17 @@ func TestNewNasMounter(t *testing.T) {
5731

5832
func TestNasMounter_MountSuccess(t *testing.T) {
5933
nasMounter := &NasMounter{
60-
Interface: successMockMounter{},
61-
alinasMounter: successMockMounter{},
34+
Interface: &successMockMounter{},
35+
alinasMounter: &successMockMounter{},
6236
}
6337
err := nasMounter.Mount("", "", "nas", []string{})
6438
assert.NoError(t, err)
6539
}
6640

6741
func TestNasMounter_FuseMountError(t *testing.T) {
6842
nasMounter := &NasMounter{
69-
Interface: errorMockMounter{},
70-
alinasMounter: errorMockMounter{},
43+
Interface: &errorMockMounter{},
44+
alinasMounter: &errorMockMounter{},
7145
}
7246
err := nasMounter.Mount("", "", "cpfs", []string{})
7347
assert.Error(t, err)

pkg/oss/csi_agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func NewCSIAgent(m metadata.MetadataProvider, socketPath string) *CSIAgent {
2020
ns := &nodeServer{
2121
metadata: m,
2222
locks: utils.NewVolumeLocks(),
23-
rawMounter: mountutils.New(""),
23+
rawMounter: mountutils.NewWithoutSystemd(""),
2424
skipAttach: true,
2525
}
2626
return &CSIAgent{

0 commit comments

Comments
 (0)