@@ -73,10 +73,11 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
73
73
parameters = make (map [string ]string )
74
74
}
75
75
var storageAccountType , subsID , resourceGroup , location , account , containerName , containerNamePrefix , protocol , customTags , secretName , secretNamespace , pvcNamespace string
76
- var isHnsEnabled , requireInfraEncryption , enableBlobVersioning * bool
76
+ var isHnsEnabled , requireInfraEncryption , enableBlobVersioning , createPrivateEndpoint , enableNfsV3 * bool
77
77
var vnetResourceGroup , vnetName , subnetName , accessTier , networkEndpointType , storageEndpointSuffix string
78
78
var matchTags , useDataPlaneAPI , getLatestAccountKey bool
79
79
var softDeleteBlobs , softDeleteContainers int32
80
+ var vnetResourceIDs []string
80
81
var err error
81
82
// set allowBlobPublicAccess as false by default
82
83
allowBlobPublicAccess := pointer .Bool (false )
@@ -240,21 +241,16 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
240
241
}
241
242
242
243
enableHTTPSTrafficOnly := true
243
- createPrivateEndpoint := false
244
244
if strings .EqualFold (networkEndpointType , privateEndpoint ) {
245
- createPrivateEndpoint = true
245
+ createPrivateEndpoint = pointer . BoolPtr ( true )
246
246
}
247
247
accountKind := string (storage .KindStorageV2 )
248
- var (
249
- vnetResourceIDs []string
250
- enableNfsV3 * bool
251
- )
252
248
if protocol == NFS {
253
249
isHnsEnabled = pointer .Bool (true )
254
250
enableNfsV3 = pointer .Bool (true )
255
251
// NFS protocol does not need account key
256
252
storeAccountKey = false
257
- if ! createPrivateEndpoint {
253
+ if ! pointer . BoolDeref ( createPrivateEndpoint , false ) {
258
254
// set VirtualNetworkResourceIDs for storage account firewall setting
259
255
vnetResourceID := d .getSubnetResourceID (vnetResourceGroup , vnetName , subnetName )
260
256
klog .V (2 ).Infof ("set vnetResourceID(%s) for NFS protocol" , vnetResourceID )
@@ -323,7 +319,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
323
319
if v , ok := d .volMap .Load (volName ); ok {
324
320
accountName = v .(string )
325
321
} else {
326
- lockKey := fmt .Sprintf ("%s%s%s%s%s%v" , storageAccountType , accountKind , resourceGroup , location , protocol , createPrivateEndpoint )
322
+ lockKey := fmt .Sprintf ("%s%s%s%s%s%v" , storageAccountType , accountKind , resourceGroup , location , protocol , pointer . BoolDeref ( createPrivateEndpoint , false ) )
327
323
// search in cache first
328
324
cache , err := d .accountSearchCache .Get (lockKey , azcache .CacheReadTypeDefault )
329
325
if err != nil {
@@ -352,7 +348,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
352
348
}
353
349
}
354
350
355
- if createPrivateEndpoint && protocol == NFS {
351
+ if pointer . BoolDeref ( createPrivateEndpoint , false ) && protocol == NFS {
356
352
// As for blobfuse/blobfuse2, serverName, i.e.,AZURE_STORAGE_BLOB_ENDPOINT env variable can't include
357
353
// "privatelink", issue: https://github.com/Azure/azure-storage-fuse/issues/1014
358
354
//
0 commit comments