Skip to content

Commit

Permalink
[bug] Azure copyPartRange should stage block on destination
Browse files Browse the repository at this point in the history
copyPartRange should stage a block on the destination.  This matters When
source and destination containers are different.
  • Loading branch information
arielshaqed committed Feb 18, 2024
1 parent 767ebc3 commit df0ada8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/block/azure/multipart_block_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ func getMultipartSize(ctx context.Context, container container.Client, objName s
return int64(size), nil
}

func copyPartRange(ctx context.Context, destinationContainer container.Client, destinationObjName string, sourceBlobURL blockblob.Client, startPosition, count int64) (*block.UploadPartResponse, error) {
func copyPartRange(ctx context.Context, destinationContainer container.Client, destinationObjName string, sourceContainer blockblob.Client, startPosition, count int64) (*block.UploadPartResponse, error) {
base64BlockID := generateRandomBlockID()
_, err := sourceBlobURL.StageBlockFromURL(ctx, base64BlockID, sourceBlobURL.URL(),
_, err := destinationContainer.StageBlockFromURL(ctx, base64BlockID, sourceContainer.URL(),

Check failure on line 179 in pkg/block/azure/multipart_block_writer.go

View workflow job for this annotation

GitHub Actions / Analyze

destinationContainer.StageBlockFromURL undefined (type container.Client has no field or method StageBlockFromURL)

Check failure on line 179 in pkg/block/azure/multipart_block_writer.go

View workflow job for this annotation

GitHub Actions / Run Go tests

destinationContainer.StageBlockFromURL undefined (type container.Client has no field or method StageBlockFromURL)

Check failure on line 179 in pkg/block/azure/multipart_block_writer.go

View workflow job for this annotation

GitHub Actions / Run Linters and Checkers

destinationContainer.StageBlockFromURL undefined (type container.Client has no field or method StageBlockFromURL)
&blockblob.StageBlockFromURLOptions{
Range: blob.HTTPRange{
Offset: startPosition,
Expand All @@ -188,7 +188,7 @@ func copyPartRange(ctx context.Context, destinationContainer container.Client, d
}

// add size and id to etag
response, err := sourceBlobURL.GetProperties(ctx, nil)
response, err := destinationContainer.GetProperties(ctx, nil)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit df0ada8

Please sign in to comment.