mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #107279 from NikhilSharmaWe/pathCheck
added devicePath check for fcDisk
This commit is contained in:
commit
874ce66d19
@ -254,7 +254,15 @@ func (util *fcUtil) AttachDisk(b fcDiskMounter) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return devicePath, nil
|
||||
exists, err := mount.PathExists(devicePath)
|
||||
if exists && err == nil {
|
||||
return devicePath, nil
|
||||
}
|
||||
if exists == false {
|
||||
return "", fmt.Errorf("device %s does not exist", devicePath)
|
||||
} else {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
// DetachDisk removes scsi device file such as /dev/sdX from the node.
|
||||
|
Loading…
Reference in New Issue
Block a user