mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 13:45:52 +03:00
[PR #1976] [MERGED] Added support from gcloud cli resumable uploads #1985
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#1985
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fsouza/fake-gcs-server/pull/1976
Author: @danieldanieltata
Created: 6/8/2025
Status: ✅ Merged
Merged: 2/4/2026
Merged by: @fsouza
Base:
main← Head:add-support-for-gcloud-cli-resumable📝 Commits (10+)
1ff0b71Added support from gcloud cli resumable uploads1d68241Update mux_transport.go6e48a66Update mux_transport.gofddb421Update mux_transport.go341e5feUpdate mux_transport.go3e7ad7cUpdate server.god71c5e0Update server.go2265ee7Update server.gofb913d1Update server_test.go0d5fa78Update server_test.go📊 Changes
7 files changed (+386 additions, -1 deletions)
View changed files
📝
.github/workflows/main.yml(+3 -0)➕
ci/run-gcloud-example.sh(+11 -0)➕
examples/gcloud/gcloud-example.sh(+26 -0)➕
examples/gcloud/image.png(+0 -0)📝
fakestorage/response.go(+2 -0)📝
fakestorage/upload.go(+145 -1)📝
fakestorage/upload_test.go(+199 -0)📄 Description
Problem
The gcloud CLI uses a different approach for resumable uploads when streaming data that wasn't previously supported by fake-gcs-server. When using commands like:
tar -czf - examples/gcloud/image.png | gcloud storage cp - gs://fake-bucket/image.tar.gzThe gcloud CLI performs "body-based resumable uploads" where the object metadata (name, content-type, etc.) is sent in the request body as JSON, rather than as query parameters or headers. This caused streaming operations from gcloud CLI to fail against fake-gcs-server.
Changes Made
handleBodyBasedResumableUploadfunction inupload.gowith comprehensive test coverage for gcloud CLI compatibility.response.gothat was affecting all cache control functionality.gcloud-example.shto explain how to use gcloud CLI with fake-gcs-serverThis is my first time writing in Go. I noticed this functionality was missing and wanted to contribute. I used the help of AI to guide me through some parts of the implementation and writing. Let me know if there’s anything I can improve or if there are any Go best practices I should follow 🙂.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.