modify detach timeout to be csiTimeout

This commit is contained in:
Chris Duchesne 2019-10-23 00:08:46 -07:00
parent 5238e1c80f
commit b4e0f1b8f8

View File

@ -386,14 +386,13 @@ func (c *csiAttacher) Detach(volumeName string, nodeName types.NodeName) error {
}
klog.V(4).Info(log("detacher deleted ok VolumeAttachment.ID=%s", attachID))
err := c.waitForVolumeDetachment(volID, attachID)
err := c.waitForVolumeDetachment(volID, attachID, csiTimeout)
return err
}
func (c *csiAttacher) waitForVolumeDetachment(volumeHandle, attachID string) error {
func (c *csiAttacher) waitForVolumeDetachment(volumeHandle, attachID string, timeout time.Duration) error {
klog.V(4).Info(log("probing for updates from CSI driver for [attachment.ID=%v]", attachID))
timeout := c.waitSleepTime * 10
timer := time.NewTimer(timeout) // TODO (vladimirvivien) investigate making this configurable
defer timer.Stop()