Skip to content

Commit

Permalink
Fix cannot mount PVC in driver (#174) (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shellmode authored Jul 29, 2024
1 parent 44f8387 commit 969a28e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/driver/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,14 @@ func NewS3Mounter(mpVersion string, kubernetesVersion string) (*S3Mounter, error
}

func (pml *ProcMountLister) ListMounts() ([]mount.MountPoint, error) {
retryTimes := 3
mounts, err := os.ReadFile(pml.ProcMountPath)
if err != nil {
return nil, fmt.Errorf("Failed to read %s: %w", procMounts, err)
if err != nil && retryTimes == 0 {
return nil, fmt.Errorf("Failed to read %s after %d tries: %w", procMounts, retryTimes, err)
} else {
retryTimes -= 1
klog.V(4).Infof("Failed to read %s, left %d tries", procMounts, retryTimes)
mounts, err = os.ReadFile(pml.ProcMountPath)
}
return parseProcMounts(mounts)
}
Expand Down

0 comments on commit 969a28e

Please sign in to comment.