From f4977569337527fcda1c1b8030c78fc7bca1f2ac Mon Sep 17 00:00:00 2001 From: umagnus Date: Tue, 2 Jan 2024 06:01:24 +0000 Subject: [PATCH] fix ut build failure --- pkg/blob/controllerserver_test.go | 38 +++++++++---------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/pkg/blob/controllerserver_test.go b/pkg/blob/controllerserver_test.go index 4b28223e4..612fec6b0 100644 --- a/pkg/blob/controllerserver_test.go +++ b/pkg/blob/controllerserver_test.go @@ -33,7 +33,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/utils/pointer" "sigs.k8s.io/blob-csi-driver/pkg/util" - "sigs.k8s.io/cloud-provider-azure/pkg/azclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient" azure "sigs.k8s.io/cloud-provider-azure/pkg/provider" @@ -1665,6 +1664,7 @@ func TestCopyVolume(t *testing.T) { name: "AADClientSecret shouldn't be nil or useManagedIdentityExtension must be set to true when accountSASToken is empty", testFunc: func(t *testing.T) { d := NewFakeDriver() + d.cloud = &azure.Cloud{} mp := map[string]string{} volumeSource := &csi.VolumeContentSource_VolumeSource{ @@ -1888,13 +1888,9 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - ARMClientConfig: azclient.ARMClientConfig{ - TenantID: "TenantID", - }, - AzureAuthConfig: azclient.AzureAuthConfig{ - AADClientID: "AADClientID", - AADClientSecret: "AADClientSecret", - }, + TenantID: "TenantID", + AADClientID: "AADClientID", + AADClientSecret: "AADClientSecret", }, }, } @@ -1918,12 +1914,8 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - ARMClientConfig: azclient.ARMClientConfig{ - TenantID: "TenantID", - }, - AzureAuthConfig: azclient.AzureAuthConfig{ - AADClientSecret: "AADClientSecret", - }, + TenantID: "TenantID", + AADClientSecret: "AADClientSecret", }, }, } @@ -1942,10 +1934,8 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - AzureAuthConfig: azclient.AzureAuthConfig{ - UseManagedIdentityExtension: true, - UserAssignedIdentityID: "UserAssignedIdentityID", - }, + UseManagedIdentityExtension: true, + UserAssignedIdentityID: "UserAssignedIdentityID", }, }, } @@ -1967,9 +1957,7 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - AzureAuthConfig: azclient.AzureAuthConfig{ - UseManagedIdentityExtension: true, - }, + UseManagedIdentityExtension: true, }, }, } @@ -2039,9 +2027,7 @@ func Test_getSASToken(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - AzureAuthConfig: azclient.AzureAuthConfig{ - UseManagedIdentityExtension: true, - }, + UseManagedIdentityExtension: true, }, }, } @@ -2073,9 +2059,7 @@ func Test_getSASToken(t *testing.T) { d.cloud = &azure.Cloud{ Config: azure.Config{ AzureAuthConfig: config.AzureAuthConfig{ - AzureAuthConfig: azclient.AzureAuthConfig{ - UseManagedIdentityExtension: true, - }, + UseManagedIdentityExtension: true, }, }, }