From b4e0f1b8f8b4de2fadf7a875742a2da913cd0a27 Mon Sep 17 00:00:00 2001 From: Chris Duchesne Date: Wed, 23 Oct 2019 00:08:46 -0700 Subject: [PATCH] modify detach timeout to be csiTimeout --- pkg/volume/csi/csi_attacher.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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()