@@ -168,6 +168,10 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
168168 Tags : tags ,
169169 }
170170
171+ lockKey := account + sku + accountKind + resourceGroup + location
172+ d .volLockMap .LockEntry (lockKey )
173+ defer d .volLockMap .UnlockEntry (lockKey )
174+
171175 var retAccount , retAccountKey string
172176 if len (req .GetSecrets ()) == 0 { // check whether account is provided by secret
173177 err = wait .ExponentialBackoff (d .cloud .RequestBackoff (), func () (bool , error ) {
@@ -197,9 +201,6 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
197201 }
198202
199203 klog .V (2 ).Infof ("begin to create file share(%s) on account(%s) type(%s) rg(%s) location(%s) size(%d) protocol(%s)" , validFileShareName , retAccount , sku , resourceGroup , location , fileShareSize , shareProtocol )
200- lockKey := retAccount + sku + accountKind + resourceGroup + location
201- d .volLockMap .LockEntry (lockKey )
202- defer d .volLockMap .UnlockEntry (lockKey )
203204 err = wait .ExponentialBackoff (d .cloud .RequestBackoff (), func () (bool , error ) {
204205 var retErr error
205206 retAccount , retAccountKey , retErr = d .CreateFileShare (accountOptions , shareOptions , req .GetSecrets ())
@@ -275,6 +276,10 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
275276 return & csi.DeleteVolumeResponse {}, nil
276277 }
277278
279+ if resourceGroupName == "" {
280+ resourceGroupName = d .cloud .ResourceGroup
281+ }
282+
278283 if err := d .DeleteFileShare (resourceGroupName , accountName , fileShareName , req .GetSecrets ()); err != nil {
279284 return nil , status .Errorf (codes .Internal , "DeleteFileShare %s under account(%s) rg(%s) failed with error: %v" , fileShareName , accountName , resourceGroupName , err )
280285 }
0 commit comments