From 7514ad4467cfd4d9d7608262e25dc4fd15e14b6c Mon Sep 17 00:00:00 2001 From: Laila Kassar Date: Wed, 31 Mar 2021 23:52:36 +0000 Subject: [PATCH 1/2] Normalize share name to not include capital letters --- pkg/volume/azure_file/azure_provision.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/volume/azure_file/azure_provision.go b/pkg/volume/azure_file/azure_provision.go index 6b4c8f834a2..1b129bbfc3c 100644 --- a/pkg/volume/azure_file/azure_provision.go +++ b/pkg/volume/azure_file/azure_provision.go @@ -198,10 +198,10 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie } if shareName == "" { - // File share name has a length limit of 63, and it cannot contain two consecutive '-'s. + // File share name has a length limit of 63, it cannot contain two consecutive '-'s, and all letters must be lower case. name := util.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 63) - shareName = strings.Replace(name, "--", "-", -1) - } + shareName = strings.ToLower(strings.Replace(name, "--", "-", -1)) +} if resourceGroup == "" { resourceGroup = a.options.PVC.ObjectMeta.Annotations[resourceGroupAnnotation] From a5fdad260f5828e7ca5940246ff35a9fd5252b9a Mon Sep 17 00:00:00 2001 From: Laila Kassar <35109471+kassarl@users.noreply.github.com> Date: Wed, 31 Mar 2021 22:54:21 -0500 Subject: [PATCH 2/2] Update pkg/volume/azure_file/azure_provision.go Co-authored-by: Shiming Zhang --- pkg/volume/azure_file/azure_provision.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/volume/azure_file/azure_provision.go b/pkg/volume/azure_file/azure_provision.go index 1b129bbfc3c..68e9cd19181 100644 --- a/pkg/volume/azure_file/azure_provision.go +++ b/pkg/volume/azure_file/azure_provision.go @@ -200,8 +200,9 @@ func (a *azureFileProvisioner) Provision(selectedNode *v1.Node, allowedTopologie if shareName == "" { // File share name has a length limit of 63, it cannot contain two consecutive '-'s, and all letters must be lower case. name := util.GenerateVolumeName(a.options.ClusterName, a.options.PVName, 63) - shareName = strings.ToLower(strings.Replace(name, "--", "-", -1)) -} + shareName = strings.Replace(name, "--", "-", -1) + shareName = strings.ToLower(shareName) + } if resourceGroup == "" { resourceGroup = a.options.PVC.ObjectMeta.Annotations[resourceGroupAnnotation]