aboutsummaryrefslogtreecommitdiff
path: root/pkg/driver/mount_util.go
diff options
context:
space:
mode:
authorViktor Kuzmin <kvaster@gmail.com>2023-08-06 20:55:56 +0300
committerViktor Kuzmin <kvaster@gmail.com>2023-08-06 20:55:56 +0300
commiteca9cde95a899ab5645b00d8c0d547abd4bc7e8e (patch)
treee3c646e031c35b0299d58407994b10b5ed38a89a /pkg/driver/mount_util.go
parentcb920765f5d0b3b7a6a54b9bacf5e9be28b46102 (diff)
downloadseaweedfs-csi-driver-eca9cde95a899ab5645b00d8c0d547abd4bc7e8e.tar.xz
seaweedfs-csi-driver-eca9cde95a899ab5645b00d8c0d547abd4bc7e8e.zip
Use single instance of mount utility - mount.New is expensive
Diffstat (limited to 'pkg/driver/mount_util.go')
-rw-r--r--pkg/driver/mount_util.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/driver/mount_util.go b/pkg/driver/mount_util.go
index d288e8c..40716d0 100644
--- a/pkg/driver/mount_util.go
+++ b/pkg/driver/mount_util.go
@@ -7,11 +7,13 @@ import (
"k8s.io/mount-utils"
)
+var mountutil = mount.New("")
+
func waitForMount(path string, timeout time.Duration) error {
var elapsed time.Duration
var interval = 10 * time.Millisecond
for {
- notMount, err := mount.New("").IsLikelyNotMountPoint(path)
+ notMount, err := mountutil.IsLikelyNotMountPoint(path)
if err != nil {
return err
}