Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 03cbe2a

Browse files
committed
fix ci problems
1 parent 3d1c512 commit 03cbe2a

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/volume/cinder/attacher.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

257261
func (attacher *cinderDiskAttacher) WaitForAttach(spec *volume.Spec, devicePath string, _ *v1.Pod, timeout time.Duration) (string, error) {

0 commit comments

Comments
 (0)