Skip to content

Commit 8aade76

Browse files
committed
fix: msi auth issue when secret is not provided
1 parent ff7c25b commit 8aade76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/blob/blob.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
468468
if name != "" {
469469
accountName = name
470470
}
471+
if err != nil && strings.EqualFold(azureStorageAuthType, "msi") {
472+
klog.V(2).Infof("ignore error(%v) since secret is optional for auth type(%s)", err, azureStorageAuthType)
473+
err = nil
474+
}
471475
if err != nil && !getAccountKeyFromSecret && (azureStorageAuthType == "" || strings.EqualFold(azureStorageAuthType, "key")) {
472476
klog.V(2).Infof("get account(%s) key from secret(%s, %s) failed with error: %v, use cluster identity to get account key instead",
473477
accountName, secretNamespace, secretName, err)

0 commit comments

Comments
 (0)