Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump k8s.io/mount-utils to v0.30.8 #1274

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
k8s.io/component-base v0.26.12
k8s.io/klog/v2 v2.120.1
k8s.io/kubelet v0.26.12
k8s.io/mount-utils v0.21.1
k8s.io/mount-utils v0.30.8
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
)

Expand Down Expand Up @@ -70,6 +70,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand Down
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0=
Expand Down Expand Up @@ -214,6 +213,8 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g=
github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM=
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -289,7 +290,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
Expand Down Expand Up @@ -532,19 +532,16 @@ k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/kubelet v0.26.12 h1:iCdPbyAKPW0LmNdayPlfOA612j+zXwVlFaq5F3kNOr0=
k8s.io/kubelet v0.26.12/go.mod h1:E3XxJLPzMQT1EcrJAVrl5rVd2Fh68DkMVpIvtWe5a3U=
k8s.io/mount-utils v0.21.1 h1:uYf6zlKaaoUcPhWn6MElLkWf/f7UQgtkPZteumgwDbA=
k8s.io/mount-utils v0.21.1/go.mod h1:dwXbIPxKtTjrBEaX1aK/CMEf1KZ8GzMHpe3NEBfdFXI=
k8s.io/mount-utils v0.30.8 h1:7fsKmKZAc7nklpHuwknmWgaE/WEY6dnDlAuyGZFN/9Y=
k8s.io/mount-utils v0.30.8/go.mod h1:9sCVmwGLcV1MPvbZ+rToMDnl1QcGozy+jBPd0MsQLIo=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
Expand Down
2 changes: 1 addition & 1 deletion pkg/disk/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func NewNodeServer(m metadata.MetadataProvider) csi.NodeServer {
metadata: m,
mounter: utils.NewMounter(),
kataBMIOType: kataBMIOType,
k8smounter: k8smount.New(""),
k8smounter: k8smount.NewWithoutSystemd(""),
podCGroup: podCgroup,
clientSet: GlobalConfigVar.ClientSet,
locks: utils.NewVolumeLocks(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/ens/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func NewNodeServer() csi.NodeServer {
MaxVolumePerNode: maxVolumesNum,
mounter: utils.NewMounter(),
podCgroup: podCgroup,
k8smounter: k8smount.New(""),
k8smounter: k8smount.NewWithoutSystemd(""),
GenericNodeServer: common.GenericNodeServer{
NodeID: GlobalConfigVar.InstanceID,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/metric/disk_stat_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func NewDiskStatCollector() (Collector, error) {
milliSecondsLatencyThreshold: getDiskLatencyThreshold(),
capacityPercentageThreshold: getDiskCapacityThreshold(),
recorder: recorder,
mounter: mount.New(""),
mounter: mount.NewWithoutSystemd(""),
nodeName: nodeName,
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/metric/nfs_stat_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func NewNfsStatCollector() (Collector, error) {
recorder: recorder,
monitorClient: NewStorageMonitorClient(clientset),
capacityPercentageThreshold: getNfsCapacityThreshold(),
mounter: mount.New(""),
mounter: mount.NewWithoutSystemd(""),
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/mounter/proxy/server/ossfs/mount_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type MountHandler struct {
func NewMountHandler() *MountHandler {
return &MountHandler{
pids: new(sync.Map),
raw: mount.New(""),
raw: mount.NewWithoutSystemd(""),
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/nas/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (m *NasMounter) Mount(source string, target string, fstype string, options
}

func NewNasMounter() mountutils.Interface {
inner := mountutils.New("")
inner := mountutils.NewWithoutSystemd("")
return &NasMounter{
Interface: inner,
fuseMounter: mounter.NewConnectorMounter(inner, ""),
Expand Down
45 changes: 10 additions & 35 deletions pkg/nas/mounter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,25 @@ package nas

import (
"errors"
"testing"

"github.com/stretchr/testify/assert"
mountutils "k8s.io/mount-utils"
"testing"
)

type baseMockMounter struct{}

func (m baseMockMounter) MountSensitive(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
return nil
}

func (m baseMockMounter) MountSensitiveWithoutSystemd(source string, target string, fstype string, options []string, sensitiveOptions []string) error {
return nil
}

func (m baseMockMounter) Unmount(target string) error {
return nil
}

func (m baseMockMounter) List() ([]mountutils.MountPoint, error) {
return []mountutils.MountPoint{}, nil
}

func (m baseMockMounter) IsLikelyNotMountPoint(file string) (bool, error) {
return false, nil
}

func (m baseMockMounter) GetMountRefs(pathname string) ([]string, error) {
return []string{}, nil
}

type successMockMounter struct {
baseMockMounter
mountutils.FakeMounter
}

func (m successMockMounter) Mount(source string, target string, fstype string, options []string) error {
func (m *successMockMounter) Mount(source string, target string, fstype string, options []string) error {
return nil
}

type errorMockMounter struct {
baseMockMounter
mountutils.FakeMounter
}

func (m errorMockMounter) Mount(source string, target string, fstype string, options []string) error {
func (m *errorMockMounter) Mount(source string, target string, fstype string, options []string) error {
return errors.New("")
}

Expand All @@ -56,17 +31,17 @@ func TestNewNasMounter(t *testing.T) {

func TestNasMounter_MountSuccess(t *testing.T) {
nasMounter := &NasMounter{
Interface: successMockMounter{},
fuseMounter: successMockMounter{},
Interface: &successMockMounter{},
fuseMounter: &successMockMounter{},
}
err := nasMounter.Mount("", "", "nas", []string{})
assert.NoError(t, err)
}

func TestNasMounter_FuseMountError(t *testing.T) {
nasMounter := &NasMounter{
Interface: errorMockMounter{},
fuseMounter: errorMockMounter{},
Interface: &errorMockMounter{},
fuseMounter: &errorMockMounter{},
}
err := nasMounter.Mount("", "", "cpfs", []string{})
assert.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/oss/csi_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewCSIAgent(m metadata.MetadataProvider, socketPath string) *CSIAgent {
ns := &nodeServer{
metadata: m,
locks: utils.NewVolumeLocks(),
rawMounter: mountutils.New(""),
rawMounter: mountutils.NewWithoutSystemd(""),
skipAttach: true,
}
return &CSIAgent{
Expand Down
2 changes: 1 addition & 1 deletion pkg/oss/oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func NewDriver(endpoint string, m metadata.MetadataProvider, serviceType utils.S
nodeName: nodeName,
clientset: clientset,
cnfsGetter: cnfsGetter,
rawMounter: mountutils.New(""),
rawMounter: mountutils.NewWithoutSystemd(""),
ossfs: ossfs,
GenericNodeServer: common.GenericNodeServer{
NodeID: nodeName,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pov/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type nodeService struct {
func newNodeService(meta metadata.MetadataProvider) nodeService {
return nodeService{
inFlight: internal.NewInFlight(),
mounter: mountutils.New(""),
mounter: mountutils.NewWithoutSystemd(""),
GenericNodeServer: common.GenericNodeServer{
NodeID: metadata.MustGet(meta, metadata.InstanceID),
},
Expand Down
Loading