Skip to content

Modern Docker Management, Designed for Everyone

fix(s3): only send request checksums when required for gcs compatibility (#4401)

Kyle Mendellf93ced902c84
diff --git a/backend/pkg/utils/s3/s3.go b/backend/pkg/utils/s3/s3.go
index 586e810ad..e8c8e887e 100644
--- a/backend/pkg/utils/s3/s3.go
+++ b/backend/pkg/utils/s3/s3.go
@@ -306,6 +306,9 @@ func newClientInternal(ctx context.Context, configuration Configuration) (*awss3
endpoint := configuration.EndpointURL()
return awss3.NewFromConfig(awsConfiguration, func(options *awss3.Options) {
options.UsePathStyle = configuration.ForcePathStyle
+ // S3-compatible stores such as GCS reject the SDK's default flexible checksums.
+ options.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired
+ options.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired
if endpoint != "" {
options.BaseEndpoint = aws.String(endpoint)
}