@@ -97,16 +97,14 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
97
97
parameters = make (map [string ]string )
98
98
}
99
99
var storageAccountType , subsID , resourceGroup , location , account , containerName , containerNamePrefix , protocol , customTags , secretName , secretNamespace , pvcNamespace , tagValueDelimiter string
100
- var isHnsEnabled , requireInfraEncryption , enableBlobVersioning , createPrivateEndpoint , enableNfsV3 * bool
100
+ var isHnsEnabled , requireInfraEncryption , enableBlobVersioning , createPrivateEndpoint , enableNfsV3 , allowSharedKeyAccess * bool
101
101
var vnetResourceGroup , vnetName , subnetName , accessTier , networkEndpointType , storageEndpointSuffix , fsGroupChangePolicy string
102
102
var matchTags , useDataPlaneAPI , getLatestAccountKey bool
103
103
var softDeleteBlobs , softDeleteContainers int32
104
104
var vnetResourceIDs []string
105
105
var err error
106
106
// set allowBlobPublicAccess as false by default
107
107
allowBlobPublicAccess := pointer .Bool (false )
108
- // set allowBlobPublicAccess as true by default
109
- allowSharedKeyAccess := pointer .Bool (true )
110
108
111
109
containerNameReplaceMap := map [string ]string {}
112
110
@@ -174,9 +172,11 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
174
172
allowBlobPublicAccess = pointer .Bool (true )
175
173
}
176
174
case allowSharedKeyAccessField :
177
- if strings .EqualFold (v , falseValue ) {
178
- allowSharedKeyAccess = pointer .Bool (false )
175
+ var boolValue bool
176
+ if boolValue , err = strconv .ParseBool (v ); err != nil {
177
+ return nil , status .Errorf (codes .InvalidArgument , "invalid %s: %s in volume context" , allowSharedKeyAccessField , v )
179
178
}
179
+ allowSharedKeyAccess = pointer .Bool (boolValue )
180
180
case requireInfraEncryptionField :
181
181
if strings .EqualFold (v , trueValue ) {
182
182
requireInfraEncryption = pointer .Bool (true )
@@ -316,7 +316,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
316
316
storageEndpointSuffix = d .getStorageEndPointSuffix ()
317
317
}
318
318
319
- if storeAccountKey && ! pointer .BoolDeref (allowSharedKeyAccess , false ) {
319
+ if storeAccountKey && ! pointer .BoolDeref (allowSharedKeyAccess , true ) {
320
320
return nil , status .Errorf (codes .InvalidArgument , "storeAccountKey is not supported for account with shared access key disabled" )
321
321
}
322
322
0 commit comments