@@ -47,62 +47,68 @@ import (
4747
4848const (
4949 // DefaultDriverName holds the name of the csi-driver
50- DefaultDriverName = "blob.csi.azure.com"
51- blobCSIDriverName = "blob_csi_driver"
52- separator = "#"
53- volumeIDTemplate = "%s#%s#%s#%s#%s#%s"
54- secretNameTemplate = "azure-storage-account-%s-secret"
55- serverNameField = "server"
56- storageEndpointSuffixField = "storageendpointsuffix"
57- tagsField = "tags"
58- matchTagsField = "matchtags"
59- protocolField = "protocol"
60- accountNameField = "accountname"
61- accountKeyField = "accountkey"
62- storageAccountField = "storageaccount"
63- storageAccountTypeField = "storageaccounttype"
64- skuNameField = "skuname"
65- subscriptionIDField = "subscriptionid"
66- resourceGroupField = "resourcegroup"
67- locationField = "location"
68- secretNameField = "secretname"
69- secretNamespaceField = "secretnamespace"
70- containerNameField = "containername"
71- containerNamePrefixField = "containernameprefix"
72- storeAccountKeyField = "storeaccountkey"
73- isHnsEnabledField = "ishnsenabled"
74- softDeleteBlobsField = "softdeleteblobs"
75- softDeleteContainersField = "softdeletecontainers"
76- enableBlobVersioningField = "enableblobversioning"
77- getAccountKeyFromSecretField = "getaccountkeyfromsecret"
78- storageSPNClientIDField = "azurestoragespnclientid"
79- storageSPNTenantIDField = "azurestoragespntenantid"
80- keyVaultURLField = "keyvaulturl"
81- keyVaultSecretNameField = "keyvaultsecretname"
82- keyVaultSecretVersionField = "keyvaultsecretversion"
83- storageAccountNameField = "storageaccountname"
84- allowBlobPublicAccessField = "allowblobpublicaccess"
85- requireInfraEncryptionField = "requireinfraencryption"
86- ephemeralField = "csi.storage.k8s.io/ephemeral"
87- podNamespaceField = "csi.storage.k8s.io/pod.namespace"
88- mountOptionsField = "mountoptions"
89- falseValue = "false"
90- trueValue = "true"
91- defaultSecretAccountName = "azurestorageaccountname"
92- defaultSecretAccountKey = "azurestorageaccountkey"
93- accountSasTokenField = "azurestorageaccountsastoken"
94- msiSecretField = "msisecret"
95- storageSPNClientSecretField = "azurestoragespnclientsecret"
96- Fuse = "fuse"
97- Fuse2 = "fuse2"
98- NFS = "nfs"
99- vnetResourceGroupField = "vnetresourcegroup"
100- vnetNameField = "vnetname"
101- subnetNameField = "subnetname"
102- accessTierField = "accesstier"
103- networkEndpointTypeField = "networkendpointtype"
104- mountPermissionsField = "mountpermissions"
105- useDataPlaneAPIField = "usedataplaneapi"
50+ DefaultDriverName = "blob.csi.azure.com"
51+ blobCSIDriverName = "blob_csi_driver"
52+ separator = "#"
53+ volumeIDTemplate = "%s#%s#%s#%s#%s#%s"
54+ secretNameTemplate = "azure-storage-account-%s-secret"
55+ serverNameField = "server"
56+ storageEndpointSuffixField = "storageendpointsuffix"
57+ tagsField = "tags"
58+ matchTagsField = "matchtags"
59+ protocolField = "protocol"
60+ accountNameField = "accountname"
61+ accountKeyField = "accountkey"
62+ storageAccountField = "storageaccount"
63+ storageAccountTypeField = "storageaccounttype"
64+ skuNameField = "skuname"
65+ subscriptionIDField = "subscriptionid"
66+ resourceGroupField = "resourcegroup"
67+ locationField = "location"
68+ secretNameField = "secretname"
69+ secretNamespaceField = "secretnamespace"
70+ containerNameField = "containername"
71+ containerNamePrefixField = "containernameprefix"
72+ storeAccountKeyField = "storeaccountkey"
73+ isHnsEnabledField = "ishnsenabled"
74+ softDeleteBlobsField = "softdeleteblobs"
75+ softDeleteContainersField = "softdeletecontainers"
76+ enableBlobVersioningField = "enableblobversioning"
77+ getAccountKeyFromSecretField = "getaccountkeyfromsecret"
78+ storageSPNClientIDField = "azurestoragespnclientid"
79+ storageSPNTenantIDField = "azurestoragespntenantid"
80+ storageAuthTypeField = "azurestorageauthtype"
81+ storageIentityClientIDField = "azurestorageidentityclientid"
82+ storageIdentityObjectIDField = "azurestorageidentityobjectid"
83+ storageIdentityResourceIDField = "azurestorageidentityresourceid"
84+ msiEndpointField = "msiendpoint"
85+ storageAADEndpointField = "azurestorageaadendpoint"
86+ keyVaultURLField = "keyvaulturl"
87+ keyVaultSecretNameField = "keyvaultsecretname"
88+ keyVaultSecretVersionField = "keyvaultsecretversion"
89+ storageAccountNameField = "storageaccountname"
90+ allowBlobPublicAccessField = "allowblobpublicaccess"
91+ requireInfraEncryptionField = "requireinfraencryption"
92+ ephemeralField = "csi.storage.k8s.io/ephemeral"
93+ podNamespaceField = "csi.storage.k8s.io/pod.namespace"
94+ mountOptionsField = "mountoptions"
95+ falseValue = "false"
96+ trueValue = "true"
97+ defaultSecretAccountName = "azurestorageaccountname"
98+ defaultSecretAccountKey = "azurestorageaccountkey"
99+ accountSasTokenField = "azurestorageaccountsastoken"
100+ msiSecretField = "msisecret"
101+ storageSPNClientSecretField = "azurestoragespnclientsecret"
102+ Fuse = "fuse"
103+ Fuse2 = "fuse2"
104+ NFS = "nfs"
105+ vnetResourceGroupField = "vnetresourcegroup"
106+ vnetNameField = "vnetname"
107+ subnetNameField = "subnetname"
108+ accessTierField = "accesstier"
109+ networkEndpointTypeField = "networkendpointtype"
110+ mountPermissionsField = "mountpermissions"
111+ useDataPlaneAPIField = "usedataplaneapi"
106112
107113 // See https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#container-names
108114 containerNameMinLength = 3
@@ -409,22 +415,22 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
409415 pvcNamespace = v
410416 case getAccountKeyFromSecretField :
411417 getAccountKeyFromSecret = strings .EqualFold (v , trueValue )
412- case "azurestorageauthtype" :
418+ case storageAuthTypeField :
413419 azureStorageAuthType = v
414420 authEnv = append (authEnv , "AZURE_STORAGE_AUTH_TYPE=" + v )
415- case "azurestorageidentityclientid" :
421+ case storageIentityClientIDField :
416422 authEnv = append (authEnv , "AZURE_STORAGE_IDENTITY_CLIENT_ID=" + v )
417- case "azurestorageidentityobjectid" :
423+ case storageIdentityObjectIDField :
418424 authEnv = append (authEnv , "AZURE_STORAGE_IDENTITY_OBJECT_ID=" + v )
419- case "azurestorageidentityresourceid" :
425+ case storageIdentityResourceIDField :
420426 authEnv = append (authEnv , "AZURE_STORAGE_IDENTITY_RESOURCE_ID=" + v )
421- case "msiendpoint" :
427+ case msiEndpointField :
422428 authEnv = append (authEnv , "MSI_ENDPOINT=" + v )
423429 case storageSPNClientIDField :
424430 storageSPNClientID = v
425431 case storageSPNTenantIDField :
426432 storageSPNTenantID = v
427- case "azurestorageaadendpoint" :
433+ case storageAADEndpointField :
428434 authEnv = append (authEnv , "AZURE_STORAGE_AAD_ENDPOINT=" + v )
429435 }
430436 }
0 commit comments