Skip to content

Commit 29c9561

Browse files
committed
fix: get account key error in nfs volume creation
1 parent befb104 commit 29c9561

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/blob/blob.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,10 @@ func (d *Driver) GetStorageAccesskey(ctx context.Context, accountOptions *azure.
598598
}
599599

600600
// read from k8s secret first
601-
_, accountKey, err := d.GetStorageAccountFromSecret(accountOptions.Name, secretNamespace)
601+
secretName := fmt.Sprintf(secretNameTemplate, accountOptions.Name)
602+
_, accountKey, err := d.GetStorageAccountFromSecret(secretName, secretNamespace)
602603
if err != nil {
603-
klog.V(2).Infof("could not get account(%s) key from secret, error: %v, use cluster identity to get account key instead", accountOptions.Name, err)
604+
klog.V(2).Infof("could not get account(%s) key from secret(%s) namespace(%s), error: %v, use cluster identity to get account key instead", accountOptions.Name, secretName, secretNamespace, err)
604605
accountKey, err = d.cloud.GetStorageAccesskey(ctx, accountOptions.Name, accountOptions.ResourceGroup)
605606
}
606607
return accountOptions.Name, accountKey, err

0 commit comments

Comments
 (0)