From 5f088973ce3042cbff1d5229b334a362d9eaf902 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 28 Sep 2017 02:48:20 +0000 Subject: [PATCH] Retry when checking Azure storage account readiness --- .../providers/azure/azure_blobDiskController.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/cloudprovider/providers/azure/azure_blobDiskController.go b/pkg/cloudprovider/providers/azure/azure_blobDiskController.go index add99294f42ee..a996326cbc53f 100644 --- a/pkg/cloudprovider/providers/azure/azure_blobDiskController.go +++ b/pkg/cloudprovider/providers/azure/azure_blobDiskController.go @@ -471,20 +471,22 @@ func (c *BlobDiskController) ensureDefaultContainer(storageAccountName string) e if err != nil { glog.V(4).Infof("azureDisk - GetStorageAccount:%s err %s", storageAccountName, err.Error()) - return false, err + return false, nil // error performing the query - retryable } if provisionState == storage.Succeeded { return true, nil } - glog.V(4).Infof("azureDisk - GetStorageAccount:%s not ready yet", storageAccountName) - // leave it for next loop/sync loop - return false, fmt.Errorf("azureDisk - Account %s has not been flagged Succeeded by ARM", storageAccountName) + glog.V(4).Infof("azureDisk - GetStorageAccount:%s not ready yet (not flagged Succeeded by ARM)", storageAccountName) + return false, nil // back off and see if the account becomes ready on next retry }) // we have failed to ensure that account is ready for us to create // the default vhd container if err != nil { + if err == kwait.ErrWaitTimeout { + return fmt.Errorf("azureDisk - timed out waiting for storage account %s to become ready", storageAccountName) + } return err } }