Skip to content

Commit f497756

Browse files
committed
fix ut build failure
1 parent 6d81809 commit f497756

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

pkg/blob/controllerserver_test.go

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"k8s.io/apimachinery/pkg/util/wait"
3434
"k8s.io/utils/pointer"
3535
"sigs.k8s.io/blob-csi-driver/pkg/util"
36-
"sigs.k8s.io/cloud-provider-azure/pkg/azclient"
3736
"sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient"
3837
"sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/mockstorageaccountclient"
3938
azure "sigs.k8s.io/cloud-provider-azure/pkg/provider"
@@ -1665,6 +1664,7 @@ func TestCopyVolume(t *testing.T) {
16651664
name: "AADClientSecret shouldn't be nil or useManagedIdentityExtension must be set to true when accountSASToken is empty",
16661665
testFunc: func(t *testing.T) {
16671666
d := NewFakeDriver()
1667+
d.cloud = &azure.Cloud{}
16681668
mp := map[string]string{}
16691669

16701670
volumeSource := &csi.VolumeContentSource_VolumeSource{
@@ -1888,13 +1888,9 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) {
18881888
d.cloud = &azure.Cloud{
18891889
Config: azure.Config{
18901890
AzureAuthConfig: config.AzureAuthConfig{
1891-
ARMClientConfig: azclient.ARMClientConfig{
1892-
TenantID: "TenantID",
1893-
},
1894-
AzureAuthConfig: azclient.AzureAuthConfig{
1895-
AADClientID: "AADClientID",
1896-
AADClientSecret: "AADClientSecret",
1897-
},
1891+
TenantID: "TenantID",
1892+
AADClientID: "AADClientID",
1893+
AADClientSecret: "AADClientSecret",
18981894
},
18991895
},
19001896
}
@@ -1918,12 +1914,8 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) {
19181914
d.cloud = &azure.Cloud{
19191915
Config: azure.Config{
19201916
AzureAuthConfig: config.AzureAuthConfig{
1921-
ARMClientConfig: azclient.ARMClientConfig{
1922-
TenantID: "TenantID",
1923-
},
1924-
AzureAuthConfig: azclient.AzureAuthConfig{
1925-
AADClientSecret: "AADClientSecret",
1926-
},
1917+
TenantID: "TenantID",
1918+
AADClientSecret: "AADClientSecret",
19271919
},
19281920
},
19291921
}
@@ -1942,10 +1934,8 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) {
19421934
d.cloud = &azure.Cloud{
19431935
Config: azure.Config{
19441936
AzureAuthConfig: config.AzureAuthConfig{
1945-
AzureAuthConfig: azclient.AzureAuthConfig{
1946-
UseManagedIdentityExtension: true,
1947-
UserAssignedIdentityID: "UserAssignedIdentityID",
1948-
},
1937+
UseManagedIdentityExtension: true,
1938+
UserAssignedIdentityID: "UserAssignedIdentityID",
19491939
},
19501940
},
19511941
}
@@ -1967,9 +1957,7 @@ func Test_authorizeAzcopyWithIdentity(t *testing.T) {
19671957
d.cloud = &azure.Cloud{
19681958
Config: azure.Config{
19691959
AzureAuthConfig: config.AzureAuthConfig{
1970-
AzureAuthConfig: azclient.AzureAuthConfig{
1971-
UseManagedIdentityExtension: true,
1972-
},
1960+
UseManagedIdentityExtension: true,
19731961
},
19741962
},
19751963
}
@@ -2039,9 +2027,7 @@ func Test_getSASToken(t *testing.T) {
20392027
d.cloud = &azure.Cloud{
20402028
Config: azure.Config{
20412029
AzureAuthConfig: config.AzureAuthConfig{
2042-
AzureAuthConfig: azclient.AzureAuthConfig{
2043-
UseManagedIdentityExtension: true,
2044-
},
2030+
UseManagedIdentityExtension: true,
20452031
},
20462032
},
20472033
}
@@ -2073,9 +2059,7 @@ func Test_getSASToken(t *testing.T) {
20732059
d.cloud = &azure.Cloud{
20742060
Config: azure.Config{
20752061
AzureAuthConfig: config.AzureAuthConfig{
2076-
AzureAuthConfig: azclient.AzureAuthConfig{
2077-
UseManagedIdentityExtension: true,
2078-
},
2062+
UseManagedIdentityExtension: true,
20792063
},
20802064
},
20812065
}

0 commit comments

Comments
 (0)