Skip to content

Commit

Permalink
fix ut build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
umagnus committed Jan 2, 2024
1 parent 6d81809 commit f497756
Showing 1 changed file with 11 additions and 27 deletions.
38 changes: 11 additions & 27 deletions pkg/blob/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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",
},
},
}
Expand All @@ -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",
},
},
}
Expand All @@ -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",
},
},
}
Expand All @@ -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,
},
},
}
Expand Down Expand Up @@ -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,
},
},
}
Expand Down Expand Up @@ -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,
},
},
}
Expand Down

0 comments on commit f497756

Please sign in to comment.