From 2f7b52757c2fab313379859df893600e9fd31060 Mon Sep 17 00:00:00 2001 From: Carlisia Date: Thu, 11 Oct 2018 12:54:05 -0700 Subject: [PATCH] Remove timeout check for snapshot service Signed-off-by: Carlisia --- pkg/cloudprovider/snapshot_service.go | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/pkg/cloudprovider/snapshot_service.go b/pkg/cloudprovider/snapshot_service.go index 9ad886442..152257912 100644 --- a/pkg/cloudprovider/snapshot_service.go +++ b/pkg/cloudprovider/snapshot_service.go @@ -17,9 +17,6 @@ limitations under the License. package cloudprovider import ( - "time" - - "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" ) @@ -50,11 +47,6 @@ type SnapshotService interface { SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) } -const ( - volumeCreateWaitTimeout = 30 * time.Second - volumeCreatePollInterval = 1 * time.Second -) - type snapshotService struct { blockStore BlockStore } @@ -74,22 +66,7 @@ func (sr *snapshotService) CreateVolumeFromSnapshot(snapshotID string, volumeTyp return "", err } - // wait for volume to be ready (up to a maximum time limit) - ticker := time.NewTicker(volumeCreatePollInterval) - defer ticker.Stop() - - timeout := time.NewTimer(volumeCreateWaitTimeout) - - for { - select { - case <-timeout.C: - return "", errors.Errorf("timeout reached waiting for volume %v to be ready", volumeID) - case <-ticker.C: - if ready, err := sr.blockStore.IsVolumeReady(volumeID, volumeAZ); err == nil && ready { - return volumeID, nil - } - } - } + return volumeID, nil } func (sr *snapshotService) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error) {