Skip to content

Commit e4985f9

Browse files
specialforestk8s-infra-cherrypick-robot
authored andcommitted
PR feedback
1 parent 405834e commit e4985f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/blob/controllerserver.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,14 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
9797
parameters = make(map[string]string)
9898
}
9999
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
101101
var vnetResourceGroup, vnetName, subnetName, accessTier, networkEndpointType, storageEndpointSuffix, fsGroupChangePolicy string
102102
var matchTags, useDataPlaneAPI, getLatestAccountKey bool
103103
var softDeleteBlobs, softDeleteContainers int32
104104
var vnetResourceIDs []string
105105
var err error
106106
// set allowBlobPublicAccess as false by default
107107
allowBlobPublicAccess := pointer.Bool(false)
108-
// set allowBlobPublicAccess as true by default
109-
allowSharedKeyAccess := pointer.Bool(true)
110108

111109
containerNameReplaceMap := map[string]string{}
112110

@@ -174,9 +172,11 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
174172
allowBlobPublicAccess = pointer.Bool(true)
175173
}
176174
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)
179178
}
179+
allowSharedKeyAccess = pointer.Bool(boolValue)
180180
case requireInfraEncryptionField:
181181
if strings.EqualFold(v, trueValue) {
182182
requireInfraEncryption = pointer.Bool(true)
@@ -316,7 +316,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
316316
storageEndpointSuffix = d.getStorageEndPointSuffix()
317317
}
318318

319-
if storeAccountKey && !pointer.BoolDeref(allowSharedKeyAccess, false) {
319+
if storeAccountKey && !pointer.BoolDeref(allowSharedKeyAccess, true) {
320320
return nil, status.Errorf(codes.InvalidArgument, "storeAccountKey is not supported for account with shared access key disabled")
321321
}
322322

0 commit comments

Comments
 (0)