@@ -230,7 +230,7 @@ func (attacher *cinderDiskAttacher) waitProbeVolume(devicePath, volumeID string)
230230 Steps : probeVolumeSteps ,
231231 }
232232
233- err := wait .ExponentialBackoff (backoff , func () (string , error ) {
233+ err := wait .ExponentialBackoff (backoff , func () (bool , error ) {
234234 glog .V (5 ).Infof ("Checking Cinder disk %q is attached." , volumeID )
235235 probeAttachedVolume ()
236236 if ! attacher .cinderProvider .ShouldTrustDevicePath () {
@@ -240,18 +240,22 @@ func (attacher *cinderDiskAttacher) waitProbeVolume(devicePath, volumeID string)
240240 exists , err := volumeutil .PathExists (devicePath )
241241 if exists && err == nil {
242242 glog .Infof ("Successfully found attached Cinder disk %q at %v." , volumeID , devicePath )
243- return devicePath , nil
243+ return true , nil
244244 } else {
245245 // Log an error, and continue checking periodically
246246 glog .Errorf ("Error: could not find attached Cinder disk %q (path: %q): %v" , volumeID , devicePath , err )
247+ return false , nil
247248 }
248249 })
249250
250- if err == wait .ErrWaitTimeout {
251- err = fmt .Errorf ("Volume %q failed to be probed within the alloted time" , volumeID )
251+ if err != nil {
252+ if err == wait .ErrWaitTimeout {
253+ err = fmt .Errorf ("Volume %q failed to be probed within the alloted time" , volumeID )
254+ }
255+ return "" , err
252256 }
253257
254- return "" , err
258+ return devicePath , nil
255259}
256260
257261func (attacher * cinderDiskAttacher ) WaitForAttach (spec * volume.Spec , devicePath string , _ * v1.Pod , timeout time.Duration ) (string , error ) {
0 commit comments