Skip to content

Commit 5d50b19

Browse files
authored
Adds support for concurrency to the ANF driver
1 parent a135482 commit 5d50b19

7 files changed

Lines changed: 405 additions & 190 deletions

File tree

config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ var (
439439
// Concurrency context
440440
IsConcurrent bool
441441
ConcurrentBackends = []string{
442+
"azure-netapp-files",
442443
"ontap-san",
443444
"fake",
444445
"ontap-nas",

storage_drivers/azure/api/azure.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type AzureClient struct {
9090
VolumesClient *netapp.VolumesClient
9191
SnapshotsClient *netapp.SnapshotsClient
9292
ResourceClient *netapp.ResourceClient
93-
AzureResources
93+
resources *AzureResources
9494
}
9595

9696
type AzureError struct {
@@ -391,6 +391,7 @@ func NewDriver(config ClientConfig) (Azure, error) {
391391
VolumesClient: volumesClient,
392392
SnapshotsClient: snapshotsClient,
393393
ResourceClient: resourceClient,
394+
resources: newAzureResources(),
394395
}
395396

396397
return Client{
@@ -454,11 +455,11 @@ func (c Client) Init(ctx context.Context, pools map[string]storage.Pool) error {
454455

455456
// RegisterStoragePool makes a note of pools defined by the driver for later mapping.
456457
func (c Client) registerStoragePools(sPools map[string]storage.Pool) {
457-
c.sdkClient.AzureResources.StoragePoolMap = make(map[string]storage.Pool)
458-
458+
m := make(map[string]storage.Pool)
459459
for _, sPool := range sPools {
460-
c.sdkClient.AzureResources.StoragePoolMap[sPool.Name()] = sPool
460+
m[sPool.Name()] = sPool
461461
}
462+
c.sdkClient.resources.SetStoragePools(m)
462463
}
463464

464465
// ///////////////////////////////////////////////////////////////////////////////
@@ -1118,7 +1119,7 @@ func (c Client) CreateVolume(ctx context.Context, request *FilesystemCreateReque
11181119

11191120
// Get the capacity pool so we can determine location and service level
11201121
cPoolFullName := CreateCapacityPoolFullName(resourceGroup, netappAccount, cPoolName)
1121-
cPool, ok := c.sdkClient.AzureResources.CapacityPoolMap[cPoolFullName]
1122+
cPool, ok := c.sdkClient.resources.GetCapacityPools().GetOk(cPoolFullName)
11221123
if !ok {
11231124
return nil, fmt.Errorf("unknown capacity pool %s", cPoolFullName)
11241125
}

0 commit comments

Comments
 (0)