Merge pull request #107279 from NikhilSharmaWe/pathCheck

added devicePath check for fcDisk
This commit is contained in:
Kubernetes Prow Robot 2022-01-18 03:05:08 -08:00 committed by GitHub
commit 874ce66d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.