@@ -314,9 +314,9 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
314
314
315
315
enableHTTPSTrafficOnly := true
316
316
shareProtocol := storage .EnabledProtocolsSMB
317
- createPrivateEndpoint := false
317
+ var createPrivateEndpoint * bool
318
318
if strings .EqualFold (networkEndpointType , privateEndpoint ) {
319
- createPrivateEndpoint = true
319
+ createPrivateEndpoint = pointer . BoolPtr ( true )
320
320
}
321
321
var vnetResourceIDs []string
322
322
if fsType == nfs || protocol == nfs {
@@ -332,7 +332,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
332
332
// reset protocol field (compatble with "fsType: nfs")
333
333
setKeyValueInMap (parameters , protocolField , protocol )
334
334
335
- if ! createPrivateEndpoint {
335
+ if ! pointer . BoolDeref ( createPrivateEndpoint , false ) {
336
336
// set VirtualNetworkResourceIDs for storage account firewall setting
337
337
vnetResourceID := d .getSubnetResourceID (vnetResourceGroup , vnetName , subnetName )
338
338
klog .V (2 ).Infof ("set vnetResourceID(%s) for NFS protocol" , vnetResourceID )
@@ -435,7 +435,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
435
435
accountName = v .(string )
436
436
} else {
437
437
lockKey = fmt .Sprintf ("%s%s%s%s%s%s%s%v%v%v%v%v" , sku , accountKind , resourceGroup , location , protocol , subsID , accountAccessTier ,
438
- createPrivateEndpoint , pointer .BoolDeref (allowBlobPublicAccess , false ), pointer .BoolDeref (requireInfraEncryption , false ),
438
+ pointer . BoolDeref ( createPrivateEndpoint , false ) , pointer .BoolDeref (allowBlobPublicAccess , false ), pointer .BoolDeref (requireInfraEncryption , false ),
439
439
pointer .BoolDeref (enableLFS , false ), pointer .BoolDeref (disableDeleteRetentionPolicy , false ))
440
440
// search in cache first
441
441
cache , err := d .accountSearchCache .Get (lockKey , azcache .CacheReadTypeDefault )
@@ -485,7 +485,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
485
485
}
486
486
}
487
487
488
- if createPrivateEndpoint {
488
+ if pointer . BoolDeref ( createPrivateEndpoint , false ) {
489
489
setKeyValueInMap (parameters , serverNameField , fmt .Sprintf ("%s.privatelink.file.%s" , accountName , storageEndpointSuffix ))
490
490
}
491
491
0 commit comments