@@ -440,7 +440,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
440440 }
441441
442442 klog .V (2 ).Infof ("begin to create container(%s) on account(%s) type(%s) subsID(%s) rg(%s) location(%s) size(%d)" , validContainerName , accountName , storageAccountType , subsID , resourceGroup , location , requestGiB )
443- if err := d .CreateBlobContainer (ctx , subsID , resourceGroup , accountName , validContainerName , secrets ); err != nil {
443+ if err := d .CreateBlobContainer (ctx , subsID , resourceGroup , accountName , validContainerName , storageEndpointSuffix , secrets ); err != nil {
444444 return nil , status .Errorf (codes .Internal , "failed to create container(%s) on account(%s) type(%s) rg(%s) location(%s) size(%d), error: %v" , validContainerName , accountName , storageAccountType , resourceGroup , location , requestGiB , err )
445445 }
446446 if volContentSource != nil {
@@ -577,7 +577,7 @@ func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.Valida
577577 var exist bool
578578 secrets := req .GetSecrets ()
579579 if len (secrets ) > 0 {
580- container , err := getContainerReference (containerName , secrets , d .getCloudEnvironment ())
580+ container , err := getContainerReference (containerName , secrets , d .getStorageEndPointSuffix ())
581581 if err != nil {
582582 return nil , status .Error (codes .Internal , err .Error ())
583583 }
@@ -694,14 +694,14 @@ func (d *Driver) ControllerExpandVolume(_ context.Context, req *csi.ControllerEx
694694}
695695
696696// CreateBlobContainer creates a blob container
697- func (d * Driver ) CreateBlobContainer (ctx context.Context , subsID , resourceGroupName , accountName , containerName string , secrets map [string ]string ) error {
697+ func (d * Driver ) CreateBlobContainer (ctx context.Context , subsID , resourceGroupName , accountName , containerName , storageEndpointSuffix string , secrets map [string ]string ) error {
698698 if containerName == "" {
699699 return fmt .Errorf ("containerName is empty" )
700700 }
701701 return wait .ExponentialBackoff (getBackOff (d .cloud .Config ), func () (bool , error ) {
702702 var err error
703703 if len (secrets ) > 0 {
704- container , getErr := getContainerReference (containerName , secrets , d . getCloudEnvironment () )
704+ container , getErr := getContainerReference (containerName , secrets , storageEndpointSuffix )
705705 if getErr != nil {
706706 return true , getErr
707707 }
@@ -740,7 +740,7 @@ func (d *Driver) DeleteBlobContainer(ctx context.Context, subsID, resourceGroupN
740740 return wait .ExponentialBackoff (getBackOff (d .cloud .Config ), func () (bool , error ) {
741741 var err error
742742 if len (secrets ) > 0 {
743- container , getErr := getContainerReference (containerName , secrets , d .getCloudEnvironment ())
743+ container , getErr := getContainerReference (containerName , secrets , d .getStorageEndPointSuffix ())
744744 if getErr != nil {
745745 return true , getErr
746746 }
0 commit comments