objstore: support GCS S3-compatible signing (#69721)#69888
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds GCS S3-compatible endpoint detection and configures a custom AWS SigV4 signer that excludes ChangesGCS S3 compatibility
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant S3Store
participant GCSCompatibility
participant V4Signer
participant GCS S3 Endpoint
S3Store->>GCSCompatibility: detect provider or endpoint
GCSCompatibility-->>S3Store: enable compatible signer
S3Store->>V4Signer: sign HEAD or list request
V4Signer-->>S3Store: return signed request
S3Store->>GCS S3 Endpoint: send request with restored Accept-Encoding
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: context deadline exceeded" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #69721
What problem does this PR solve?
Issue Number: close #69718
Problem Summary:
IMPORT INTOcan fail when reading source files from GCS through the S3-compatible endpoint after the S3 implementation moved to AWS SDK for Go v2.With gcs s3 compatible endpoint, SDK v2 can sign
accept-encodinginto the SigV4 canonical request. GCS S3 interoperability can reject these requests withSignatureDoesNotMatch, and region discovery can fail onHeadBucketbefore the import starts.What changed and how does it work?
This PR adds a GCS S3-compatible mode for the S3 object store:
provider=gcsandendpoint=https://storage.googleapis.com, or virtual-hosted GCS endpoints.accept-encodingfrom the canonical request while still sending the header on the HTTP request.The signer keeps the AWS SDK v2 client path. Live GCS S3-compatible testing showed that
amz-sdk-invocation-idandamz-sdk-requestcan remain signed; onlyaccept-encodingneeds to be excluded.Check List
Tests
Manual live test against the real GCS S3-compatible endpoint:
IMPORT INTOsucceeded, which validates both source discovery (ListObjectsV2) and the following object reads (GetObject).ADMIN CHECK TABLE.SignatureDoesNotMatch,Forbidden, orfailed to walk dir.Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
New Features
Accept-Encodingfrom signed headers.Tests