@@ -440,7 +440,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
440
440
}
441
441
442
442
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 {
444
444
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 )
445
445
}
446
446
if volContentSource != nil {
@@ -577,7 +577,7 @@ func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.Valida
577
577
var exist bool
578
578
secrets := req .GetSecrets ()
579
579
if len (secrets ) > 0 {
580
- container , err := getContainerReference (containerName , secrets , d .getCloudEnvironment ())
580
+ container , err := getContainerReference (containerName , secrets , d .getStorageEndPointSuffix ())
581
581
if err != nil {
582
582
return nil , status .Error (codes .Internal , err .Error ())
583
583
}
@@ -694,14 +694,14 @@ func (d *Driver) ControllerExpandVolume(_ context.Context, req *csi.ControllerEx
694
694
}
695
695
696
696
// 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 {
698
698
if containerName == "" {
699
699
return fmt .Errorf ("containerName is empty" )
700
700
}
701
701
return wait .ExponentialBackoff (getBackOff (d .cloud .Config ), func () (bool , error ) {
702
702
var err error
703
703
if len (secrets ) > 0 {
704
- container , getErr := getContainerReference (containerName , secrets , d . getCloudEnvironment () )
704
+ container , getErr := getContainerReference (containerName , secrets , storageEndpointSuffix )
705
705
if getErr != nil {
706
706
return true , getErr
707
707
}
@@ -740,7 +740,7 @@ func (d *Driver) DeleteBlobContainer(ctx context.Context, subsID, resourceGroupN
740
740
return wait .ExponentialBackoff (getBackOff (d .cloud .Config ), func () (bool , error ) {
741
741
var err error
742
742
if len (secrets ) > 0 {
743
- container , getErr := getContainerReference (containerName , secrets , d .getCloudEnvironment ())
743
+ container , getErr := getContainerReference (containerName , secrets , d .getStorageEndPointSuffix ())
744
744
if getErr != nil {
745
745
return true , getErr
746
746
}
0 commit comments