File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ const {
21
21
UploadPartCopyCommand,
22
22
} = require ( '@aws-sdk/client-s3' ) ;
23
23
24
+ const { fix_error_object } = require ( './noobaa_s3_client/noobaa_s3_client' ) ;
25
+
24
26
/**
25
27
* @implements {nb.Namespace}
26
28
*/
@@ -62,6 +64,11 @@ class NamespaceGCP {
62
64
private_key : this . private_key ,
63
65
}
64
66
} ) ;
67
+ /* An S3 client is needed for multipart upload since GCP only supports multipart i[;pads] via the S3-compatible XML API
68
+ * https://cloud.google.com/storage/docs/multipart-uploads
69
+ * This is also the reason an HMAC key is generated as part of `add_external_connection` - since the standard GCP credentials
70
+ * cannot be used in conjunction with the S3 client.
71
+ */
65
72
this . s3_client = new S3Client ( {
66
73
endpoint : 'https://storage.googleapis.com' ,
67
74
region : 'auto' , //https://cloud.google.com/storage/docs/aws-simple-migration#storage-list-buckets-s3-python
@@ -375,6 +382,7 @@ class NamespaceGCP {
375
382
const command = new UploadPartCommand ( request ) ;
376
383
res = await this . s3_client . send ( command ) ;
377
384
} catch ( err ) {
385
+ fix_error_object ( err ) ;
378
386
object_sdk . rpc_client . pool . update_issues_report ( {
379
387
namespace_resource_id : this . namespace_resource_id ,
380
388
error_code : String ( err . code ) ,
You can’t perform that action at this time.
0 commit comments