From 1d4512d2fef4214bbfaeb6b521c18dbec5eb495a 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 372353cfa8..a22e264ffd 100644 --- a/pkg/provider/azure_storageaccount.go +++ b/pkg/provider/azure_storageaccount.go @@ -129,6 +129,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