Skip to content

Commit 09a2ca2

Browse files
authored
Merge pull request #2737 from k8s-infra-cherrypick-robot/cherry-pick-2733-to-release-1.32
[release-1.32] fix: respect secretName during volume creation
2 parents 7776e8f + dc06592 commit 09a2ca2

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)