mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
optimize ifelse
This commit is contained in:
parent
bcea98234f
commit
e1a5e8537a
@ -211,7 +211,9 @@ func (attacher *awsElasticBlockStoreAttacher) MountDevice(spec *volume.Spec, dev
|
||||
mounter := attacher.host.GetMounter(awsElasticBlockStorePluginName)
|
||||
notMnt, err := mounter.IsLikelyNotMountPoint(deviceMountPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
dir := deviceMountPath
|
||||
if runtime.GOOS == "windows" {
|
||||
// On Windows, FormatAndMount will mklink (create a symbolic link) at deviceMountPath later, so don't create a
|
||||
@ -225,9 +227,6 @@ func (attacher *awsElasticBlockStoreAttacher) MountDevice(spec *volume.Spec, dev
|
||||
return fmt.Errorf("making dir %s failed with %s", dir, err)
|
||||
}
|
||||
notMnt = true
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
volumeSource, readOnly, err := getVolumeSource(spec)
|
||||
|
Loading…
Reference in New Issue
Block a user