@@ -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
9696type 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.
456457func (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