@@ -590,54 +590,6 @@ func TestGetAuthEnv(t *testing.T) {
590
590
}
591
591
},
592
592
},
593
- {
594
- name : "valid request with MSIAuthTypeAddsIdentityEnv" ,
595
- testFunc : func (t * testing.T ) {
596
- d := NewFakeDriver ()
597
- d .cloud = & storage.AccountRepo {}
598
- d .cloud .Config .AzureAuthConfig = azclient.AzureAuthConfig {
599
- UserAssignedIdentityID : "unit-test-identity-id" ,
600
- }
601
-
602
- attrib := map [string ]string {
603
- subscriptionIDField : "subID" ,
604
- resourceGroupField : "rg" ,
605
- storageAccountField : "accountname" ,
606
- storageAccountNameField : "accountname" ,
607
- secretNameField : "secretName" ,
608
- secretNamespaceField : "sNS" ,
609
- containerNameField : "containername" ,
610
- mountWithWITokenField : "false" ,
611
- pvcNamespaceKey : "pvcNSKey" ,
612
- getAccountKeyFromSecretField : "false" ,
613
- storageAuthTypeField : storageAuthTypeMSI ,
614
- msiEndpointField : "msiEndpoint" ,
615
- getLatestAccountKeyField : "true" ,
616
- }
617
- secret := make (map [string ]string )
618
- volumeID := "rg#f5713de20cde511e8ba4900#pvc-fuse-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41"
619
- ctrl := gomock .NewController (t )
620
- defer ctrl .Finish ()
621
- mockStorageAccountsClient := mock_accountclient .NewMockInterface (ctrl )
622
- d .cloud .ComputeClientFactory = mock_azclient .NewMockClientFactory (ctrl )
623
- d .cloud .ComputeClientFactory .(* mock_azclient.MockClientFactory ).EXPECT ().GetAccountClient ().Return (mockStorageAccountsClient ).AnyTimes ()
624
- s := "unit-test"
625
- accountkey := armstorage.AccountKey {Value : & s }
626
- list := []* armstorage.AccountKey {& accountkey }
627
- mockStorageAccountsClient .EXPECT ().ListKeys (gomock .Any (), gomock .Any (), gomock .Any ()).Return (list , nil ).AnyTimes ()
628
- d .cloud .ComputeClientFactory .(* mock_azclient.MockClientFactory ).EXPECT ().GetAccountClientForSub (gomock .Any ()).Return (mockStorageAccountsClient , nil ).AnyTimes ()
629
- _ , _ , _ , _ , authEnv , err := d .GetAuthEnv (context .TODO (), volumeID , "" , attrib , secret )
630
- assert .NoError (t , err )
631
- found := false
632
- for _ , env := range authEnv {
633
- if env == "AZURE_STORAGE_IDENTITY_CLIENT_ID=unit-test-identity-id" {
634
- found = true
635
- break
636
- }
637
- }
638
- assert .True (t , found , "AZURE_STORAGE_IDENTITY_CLIENT_ID should be present in authEnv" )
639
- },
640
- },
641
593
{
642
594
name : "invalid getLatestAccountKey value" ,
643
595
testFunc : func (t * testing.T ) {
0 commit comments