mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Merge pull request #9957 from rootfs/fix-9952
check IsNotExist error when validating mountpoint
This commit is contained in:
commit
b48aa0b693
@ -101,7 +101,8 @@ func (util *RBDUtil) AttachDisk(rbd rbd) error {
|
||||
// mount it
|
||||
globalPDPath := rbd.manager.MakeGlobalPDName(rbd)
|
||||
mountpoint, err := rbd.mounter.IsMountPoint(globalPDPath)
|
||||
if err != nil {
|
||||
// in the first time, the path shouldn't exist and IsMountPoint is expected to get NotExist
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return fmt.Errorf("rbd: %s failed to check mountpoint", globalPDPath)
|
||||
}
|
||||
if mountpoint {
|
||||
|
Loading…
Reference in New Issue
Block a user