From 38a25033f87c9038d844e9331857072bb4e457e2 Mon Sep 17 00:00:00 2001 From: andyzhangx Date: Wed, 10 Jul 2024 08:33:33 +0000 Subject: [PATCH] fix: not listing all accounts by default --- pkg/provider/azure_storageaccount.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/provider/azure_storageaccount.go b/pkg/provider/azure_storageaccount.go index 95f8720c8f..a18dc4d0cc 100644 --- a/pkg/provider/azure_storageaccount.go +++ b/pkg/provider/azure_storageaccount.go @@ -124,6 +124,10 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account } accounts = append(accounts, accountWithLocation{Name: *acct.Name, StorageType: string((*acct.Sku).Name), Location: *acct.Location}) + if !accountOptions.PickRandomMatchingAccount { + // return the first matching account if it's not required to pick a random one + break + } } } return accounts, nil