Skip to content

Commit 32fdd6b

Browse files
committed
fix: add AzureStorageAuthType
fix yamllint remove logging
1 parent 8b9e508 commit 32fdd6b

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

deploy/example/pv-blobfuse-auth.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
apiVersion: v1
3+
kind: PersistentVolume
4+
metadata:
5+
name: pv-blob
6+
spec:
7+
capacity:
8+
storage: 10Gi
9+
accessModes:
10+
- ReadWriteMany
11+
persistentVolumeReclaimPolicy: Retain # "Delete" is not supported in static provisioning
12+
mountOptions:
13+
- -o allow_other
14+
- --file-cache-timeout-in-seconds=120
15+
csi:
16+
driver: blob.csi.azure.com
17+
readOnly: false
18+
volumeHandle: uniqe-volumeid # make sure this volumeid is unique in the cluster
19+
volumeAttributes:
20+
resourceGroup: EXISTING_RESOURCE_GROUP_NAME
21+
storageAccount: EXISTING_STORAGE_ACCOUNT_NAME
22+
containerName: EXISTING_CONTAINER_NAME
23+
# refer to https://github.com/Azure/azure-storage-fuse#environment-variables
24+
AzureStorageAuthType: key # key, sas, msi, spn
25+
AzureStorageIdentityClientID:
26+
AzureStorageIdentityObjectID:
27+
AzureStorageIdentityResourceID:
28+
MSIEndpoint:
29+
AzureStorageSPNClientID:
30+
AzureStorageSPNTenantID:
31+
AzureStorageAADEndpoint:
32+
nodeStageSecretRef: # secret should be stored here
33+
name: azure-secret
34+
namespace: default

deploy/example/storageclass-blobfuse-msi.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

pkg/blob/blob.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID string, attrib, secret
271271
keyVaultSecretVersion = v
272272
case "storageaccountname":
273273
accountName = v
274+
case "azurestorageauthtype":
275+
authEnv = append(authEnv, "AZURE_STORAGE_AUTH_TYPE="+v)
274276
case "azurestorageidentityclientid":
275277
authEnv = append(authEnv, "AZURE_STORAGE_IDENTITY_CLIENT_ID="+v)
276278
case "azurestorageidentityobjectid":
@@ -287,6 +289,7 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID string, attrib, secret
287289
authEnv = append(authEnv, "AZURE_STORAGE_AAD_ENDPOINT="+v)
288290
}
289291
}
292+
klog.V(2).Infof("volumeID(%s) authEnv: %s", volumeID, authEnv)
290293

291294
// 1. If keyVaultURL is not nil, preferentially use the key stored in key vault.
292295
// 2. Then if secrets map is not nil, use the key stored in the secrets map.
@@ -432,8 +435,7 @@ func (d *Driver) GetStorageAccountAndContainer(ctx context.Context, volumeID str
432435
}
433436

434437
func IsCorruptedDir(dir string) bool {
435-
pathExists, pathErr := mount.PathExists(dir)
436-
fmt.Printf("IsCorruptedDir(%s) returned with error: (%v, %v)\\n", dir, pathExists, pathErr)
438+
_, pathErr := mount.PathExists(dir)
437439
return pathErr != nil && mount.IsCorruptedMnt(pathErr)
438440
}
439441

0 commit comments

Comments
 (0)