Skip to content
Merged
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
10 changes: 6 additions & 4 deletions pkg/blob/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,14 @@ func (d *Driver) ensureMountPoint(target string, perm os.FileMode) (bool, error)
}

func waitForMount(path string, intervel, timeout time.Duration) error {
timeAfter := time.After(timeout)
timeTick := time.Tick(intervel)
timer := time.NewTimer(timeout)
defer timer.Stop()
ticker := time.NewTicker(intervel)
defer ticker.Stop()

for {
select {
case <-timeTick:
case <-ticker.C:
notMount, err := mount.New("").IsLikelyNotMountPoint(path)
if err != nil {
return err
Expand All @@ -767,7 +769,7 @@ func waitForMount(path string, intervel, timeout time.Duration) error {
klog.V(2).Infof("blobfuse mount at %s success", path)
return nil
}
case <-timeAfter:
case <-timer.C:
return fmt.Errorf("timeout waiting for mount %s", path)
}
}
Expand Down
Loading