Skip to content

Commit

Permalink
Merge pull request kubernetes#35629 from hpcloud/bug/33128-unused-wai…
Browse files Browse the repository at this point in the history
…tfordetach

Automatic merge from submit-queue

Remove unused WaitForDetach from Detacher interface and plugins

See issue kubernetes#33128 and PR kubernetes#33270

We can't rely on the device name provided by OpenStack Cinder, and thus
must perform detection based on the drive serial number (aka It's cinder ID)
on the kubelet itself.

This needs to be removed now, as part of kubernetes#33128, as the code can't be
updated to attempt device detection and fallback through to the Cinder
provided deviceName, as detection "fails" when the device is gone, and
if cinder has reported a deviceName that another volume has used in
relaity, then this will block forever (or until the other, unreleated,
volume has been detached)
  • Loading branch information
Kubernetes Submit Queue authored Nov 6, 2016
2 parents 7999a0f + c76a4ba commit aa58e42
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions pkg/volume/cinder/attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,27 +281,6 @@ func (detacher *cinderDiskDetacher) Detach(deviceMountPath string, nodeName type
return nil
}

func (detacher *cinderDiskDetacher) WaitForDetach(devicePath string, timeout time.Duration) error {
ticker := time.NewTicker(checkSleepDuration)
defer ticker.Stop()
timer := time.NewTimer(timeout)
defer timer.Stop()

for {
select {
case <-ticker.C:
glog.V(5).Infof("Checking device %q is detached.", devicePath)
if pathExists, err := volumeutil.PathExists(devicePath); err != nil {
return fmt.Errorf("Error checking if device path exists: %v", err)
} else if !pathExists {
return nil
}
case <-timer.C:
return fmt.Errorf("Timeout reached; PD Device %v is still attached", devicePath)
}
}
}

func (detacher *cinderDiskDetacher) UnmountDevice(deviceMountPath string) error {
return volumeutil.UnmountPath(deviceMountPath, detacher.mounter)
}

0 comments on commit aa58e42

Please sign in to comment.