Skip to content

Commit dc06592

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored andcommitted
fix: respect secretName during volume creation
1 parent d0d9fc6 commit dc06592

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/azurefile/controllerserver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
569569

570570
accountOptions.Name = accountName
571571
secret := req.GetSecrets()
572-
if len(secret) == 0 && strings.EqualFold(useDataPlaneAPI, trueValue) {
572+
if len(secret) == 0 && (strings.EqualFold(useDataPlaneAPI, trueValue) || secretName != "") {
573573
if accountKey == "" {
574574
if accountKey, err = d.GetStorageAccesskey(ctx, accountOptions, secret, secretName, secretNamespace); err != nil {
575575
return nil, status.Errorf(codes.Internal, "failed to GetStorageAccesskey on account(%s) rg(%s), error: %v", accountOptions.Name, accountOptions.ResourceGroup, err)

0 commit comments

Comments
 (0)