diff --git a/pkg/volume/csi/csi_attacher.go b/pkg/volume/csi/csi_attacher.go index 79a1f2b3a2f..1ca94ddfdfa 100644 --- a/pkg/volume/csi/csi_attacher.go +++ b/pkg/volume/csi/csi_attacher.go @@ -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()