Skip to content

Commit 8635bf3

Browse files
authored
Merge branch 'release-1.22' into cherry-pick-953-to-release-1.22
2 parents b80c637 + 4fa82a9 commit 8635bf3

File tree

3 files changed

+81
-63
lines changed

3 files changed

+81
-63
lines changed

pkg/blob/blob.go

Lines changed: 69 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -48,63 +48,69 @@ import (
4848

4949
const (
5050
// DefaultDriverName holds the name of the csi-driver
51-
DefaultDriverName = "blob.csi.azure.com"
52-
blobCSIDriverName = "blob_csi_driver"
53-
separator = "#"
54-
volumeIDTemplate = "%s#%s#%s#%s#%s#%s"
55-
secretNameTemplate = "azure-storage-account-%s-secret"
56-
serverNameField = "server"
57-
storageEndpointSuffixField = "storageendpointsuffix"
58-
tagsField = "tags"
59-
matchTagsField = "matchtags"
60-
protocolField = "protocol"
61-
accountNameField = "accountname"
62-
accountKeyField = "accountkey"
63-
storageAccountField = "storageaccount"
64-
storageAccountTypeField = "storageaccounttype"
65-
skuNameField = "skuname"
66-
subscriptionIDField = "subscriptionid"
67-
resourceGroupField = "resourcegroup"
68-
locationField = "location"
69-
secretNameField = "secretname"
70-
secretNamespaceField = "secretnamespace"
71-
containerNameField = "containername"
72-
containerNamePrefixField = "containernameprefix"
73-
storeAccountKeyField = "storeaccountkey"
74-
getLatestAccountKeyField = "getlatestaccountkey"
75-
isHnsEnabledField = "ishnsenabled"
76-
softDeleteBlobsField = "softdeleteblobs"
77-
softDeleteContainersField = "softdeletecontainers"
78-
enableBlobVersioningField = "enableblobversioning"
79-
getAccountKeyFromSecretField = "getaccountkeyfromsecret"
80-
storageSPNClientIDField = "azurestoragespnclientid"
81-
storageSPNTenantIDField = "azurestoragespntenantid"
82-
keyVaultURLField = "keyvaulturl"
83-
keyVaultSecretNameField = "keyvaultsecretname"
84-
keyVaultSecretVersionField = "keyvaultsecretversion"
85-
storageAccountNameField = "storageaccountname"
86-
allowBlobPublicAccessField = "allowblobpublicaccess"
87-
requireInfraEncryptionField = "requireinfraencryption"
88-
ephemeralField = "csi.storage.k8s.io/ephemeral"
89-
podNamespaceField = "csi.storage.k8s.io/pod.namespace"
90-
mountOptionsField = "mountoptions"
91-
falseValue = "false"
92-
trueValue = "true"
93-
defaultSecretAccountName = "azurestorageaccountname"
94-
defaultSecretAccountKey = "azurestorageaccountkey"
95-
accountSasTokenField = "azurestorageaccountsastoken"
96-
msiSecretField = "msisecret"
97-
storageSPNClientSecretField = "azurestoragespnclientsecret"
98-
Fuse = "fuse"
99-
Fuse2 = "fuse2"
100-
NFS = "nfs"
101-
vnetResourceGroupField = "vnetresourcegroup"
102-
vnetNameField = "vnetname"
103-
subnetNameField = "subnetname"
104-
accessTierField = "accesstier"
105-
networkEndpointTypeField = "networkendpointtype"
106-
mountPermissionsField = "mountpermissions"
107-
useDataPlaneAPIField = "usedataplaneapi"
51+
DefaultDriverName = "blob.csi.azure.com"
52+
blobCSIDriverName = "blob_csi_driver"
53+
separator = "#"
54+
volumeIDTemplate = "%s#%s#%s#%s#%s#%s"
55+
secretNameTemplate = "azure-storage-account-%s-secret"
56+
serverNameField = "server"
57+
storageEndpointSuffixField = "storageendpointsuffix"
58+
tagsField = "tags"
59+
matchTagsField = "matchtags"
60+
protocolField = "protocol"
61+
accountNameField = "accountname"
62+
accountKeyField = "accountkey"
63+
storageAccountField = "storageaccount"
64+
storageAccountTypeField = "storageaccounttype"
65+
skuNameField = "skuname"
66+
subscriptionIDField = "subscriptionid"
67+
resourceGroupField = "resourcegroup"
68+
locationField = "location"
69+
secretNameField = "secretname"
70+
secretNamespaceField = "secretnamespace"
71+
containerNameField = "containername"
72+
containerNamePrefixField = "containernameprefix"
73+
storeAccountKeyField = "storeaccountkey"
74+
getLatestAccountKeyField = "getlatestaccountkey"
75+
isHnsEnabledField = "ishnsenabled"
76+
softDeleteBlobsField = "softdeleteblobs"
77+
softDeleteContainersField = "softdeletecontainers"
78+
enableBlobVersioningField = "enableblobversioning"
79+
getAccountKeyFromSecretField = "getaccountkeyfromsecret"
80+
storageSPNClientIDField = "azurestoragespnclientid"
81+
storageSPNTenantIDField = "azurestoragespntenantid"
82+
storageAuthTypeField = "azurestorageauthtype"
83+
storageIentityClientIDField = "azurestorageidentityclientid"
84+
storageIdentityObjectIDField = "azurestorageidentityobjectid"
85+
storageIdentityResourceIDField = "azurestorageidentityresourceid"
86+
msiEndpointField = "msiendpoint"
87+
storageAADEndpointField = "azurestorageaadendpoint"
88+
keyVaultURLField = "keyvaulturl"
89+
keyVaultSecretNameField = "keyvaultsecretname"
90+
keyVaultSecretVersionField = "keyvaultsecretversion"
91+
storageAccountNameField = "storageaccountname"
92+
allowBlobPublicAccessField = "allowblobpublicaccess"
93+
requireInfraEncryptionField = "requireinfraencryption"
94+
ephemeralField = "csi.storage.k8s.io/ephemeral"
95+
podNamespaceField = "csi.storage.k8s.io/pod.namespace"
96+
mountOptionsField = "mountoptions"
97+
falseValue = "false"
98+
trueValue = "true"
99+
defaultSecretAccountName = "azurestorageaccountname"
100+
defaultSecretAccountKey = "azurestorageaccountkey"
101+
accountSasTokenField = "azurestorageaccountsastoken"
102+
msiSecretField = "msisecret"
103+
storageSPNClientSecretField = "azurestoragespnclientsecret"
104+
Fuse = "fuse"
105+
Fuse2 = "fuse2"
106+
NFS = "nfs"
107+
vnetResourceGroupField = "vnetresourcegroup"
108+
vnetNameField = "vnetname"
109+
subnetNameField = "subnetname"
110+
accessTierField = "accesstier"
111+
networkEndpointTypeField = "networkendpointtype"
112+
mountPermissionsField = "mountpermissions"
113+
useDataPlaneAPIField = "usedataplaneapi"
108114

109115
// See https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata#container-names
110116
containerNameMinLength = 3
@@ -412,22 +418,22 @@ func (d *Driver) GetAuthEnv(ctx context.Context, volumeID, protocol string, attr
412418
pvcNamespace = v
413419
case getAccountKeyFromSecretField:
414420
getAccountKeyFromSecret = strings.EqualFold(v, trueValue)
415-
case "azurestorageauthtype":
421+
case storageAuthTypeField:
416422
azureStorageAuthType = v
417423
authEnv = append(authEnv, "AZURE_STORAGE_AUTH_TYPE="+v)
418-
case "azurestorageidentityclientid":
424+
case storageIentityClientIDField:
419425
authEnv = append(authEnv, "AZURE_STORAGE_IDENTITY_CLIENT_ID="+v)
420-
case "azurestorageidentityobjectid":
426+
case storageIdentityObjectIDField:
421427
authEnv = append(authEnv, "AZURE_STORAGE_IDENTITY_OBJECT_ID="+v)
422-
case "azurestorageidentityresourceid":
428+
case storageIdentityResourceIDField:
423429
authEnv = append(authEnv, "AZURE_STORAGE_IDENTITY_RESOURCE_ID="+v)
424-
case "msiendpoint":
430+
case msiEndpointField:
425431
authEnv = append(authEnv, "MSI_ENDPOINT="+v)
426432
case storageSPNClientIDField:
427433
storageSPNClientID = v
428434
case storageSPNTenantIDField:
429435
storageSPNTenantID = v
430-
case "azurestorageaadendpoint":
436+
case storageAADEndpointField:
431437
authEnv = append(authEnv, "AZURE_STORAGE_AAD_ENDPOINT="+v)
432438
case getLatestAccountKeyField:
433439
if getLatestAccountKey, err = strconv.ParseBool(v); err != nil {

pkg/blob/controllerserver.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
158158
case pvNameKey:
159159
containerNameReplaceMap[pvNameMetadata] = v
160160
case serverNameField:
161+
case storageAuthTypeField:
162+
case storageIentityClientIDField:
163+
case storageIdentityObjectIDField:
164+
case storageIdentityResourceIDField:
165+
case msiEndpointField:
166+
case storageAADEndpointField:
161167
// no op, only used in NodeStageVolume
162168
case storageEndpointSuffixField:
163169
storageEndpointSuffix = v

pkg/blob/controllerserver_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,12 @@ func TestCreateVolume(t *testing.T) {
564564
mp[resourceGroupField] = "unit-test"
565565
mp[containerNameField] = "unit-test"
566566
mp[mountPermissionsField] = "0750"
567+
mp[storageAuthTypeField] = "msi"
568+
mp[storageIentityClientIDField] = "msi"
569+
mp[storageIdentityObjectIDField] = "msi"
570+
mp[storageIdentityResourceIDField] = "msi"
571+
mp[msiEndpointField] = "msi"
572+
mp[storageAADEndpointField] = "msi"
567573
req := &csi.CreateVolumeRequest{
568574
Name: "unit-test",
569575
VolumeCapabilities: stdVolumeCapabilities,

0 commit comments

Comments
 (0)