Merge pull request #84321 from cduchesne/csi-detach-timeout

CSI: modify detach timeout to match attach timeout
This commit is contained in:
Kubernetes Prow Robot 2019-10-25 09:54:13 -07:00 committed by GitHub
commit cb0f80efe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()