Skip to content

Commit b40c5f9

Browse files
committed
fix: only copy volume to different account if storageAccount is specified
1 parent 4268fe5 commit b40c5f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/blob/controllerserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
440440
if err != nil {
441441
return nil, status.Errorf(codes.Internal, "failed to getAzcopyAuth on account(%s) rg(%s), error: %v", accountOptions.Name, accountOptions.ResourceGroup, err)
442442
}
443-
if err := d.copyVolume(req, accountSASToken, authAzcopyEnv, accountName, validContainerName, storageEndpointSuffix); err != nil {
443+
if err := d.copyVolume(req, accountSASToken, authAzcopyEnv, account, validContainerName, storageEndpointSuffix); err != nil {
444444
return nil, err
445445
}
446446
} else {
@@ -755,7 +755,7 @@ func (d *Driver) DeleteBlobContainer(ctx context.Context, subsID, resourceGroupN
755755
})
756756
}
757757

758-
// CopyBlobContainer copies a blob container
758+
// CopyBlobContainer copies a blob container, if dstAccountName is empty, then copy in the same account
759759
func (d *Driver) copyBlobContainer(req *csi.CreateVolumeRequest, accountSasToken string, authAzcopyEnv []string, dstAccountName, dstContainerName, storageEndpointSuffix string) error {
760760
var sourceVolumeID string
761761
if req.GetVolumeContentSource() != nil && req.GetVolumeContentSource().GetVolume() != nil {

0 commit comments

Comments
 (0)