aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_key_rotation.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/s3api_key_rotation.go')
-rw-r--r--weed/s3api/s3api_key_rotation.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/weed/s3api/s3api_key_rotation.go b/weed/s3api/s3api_key_rotation.go
index 499505678..050a2826c 100644
--- a/weed/s3api/s3api_key_rotation.go
+++ b/weed/s3api/s3api_key_rotation.go
@@ -175,13 +175,14 @@ func (s3a *S3ApiServer) rotateSSECChunk(chunk *filer_pb.FileChunk, sourceKey, de
}
// Get source chunk data
- srcUrl, err := s3a.lookupVolumeUrl(chunk.GetFileIdString())
+ fileId := chunk.GetFileIdString()
+ srcUrl, err := s3a.lookupVolumeUrl(fileId)
if err != nil {
return nil, fmt.Errorf("lookup source volume: %w", err)
}
// Download encrypted data
- encryptedData, err := s3a.downloadChunkData(srcUrl, 0, int64(chunk.Size))
+ encryptedData, err := s3a.downloadChunkData(srcUrl, fileId, 0, int64(chunk.Size))
if err != nil {
return nil, fmt.Errorf("download chunk data: %w", err)
}
@@ -243,13 +244,14 @@ func (s3a *S3ApiServer) rotateSSEKMSChunk(chunk *filer_pb.FileChunk, srcKeyID, d
}
// Get source chunk data
- srcUrl, err := s3a.lookupVolumeUrl(chunk.GetFileIdString())
+ fileId := chunk.GetFileIdString()
+ srcUrl, err := s3a.lookupVolumeUrl(fileId)
if err != nil {
return nil, fmt.Errorf("lookup source volume: %w", err)
}
// Download data (this would be encrypted with the old KMS key)
- chunkData, err := s3a.downloadChunkData(srcUrl, 0, int64(chunk.Size))
+ chunkData, err := s3a.downloadChunkData(srcUrl, fileId, 0, int64(chunk.Size))
if err != nil {
return nil, fmt.Errorf("download chunk data: %w", err)
}