mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-26 14:15:49 +03:00
[GH-ISSUE #237] Object.NewReader doesn't seem to be hitting the right endpoint #46
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#46
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?
Originally created by @simondrake on GitHub (May 7, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/237
Firstly, thanks for the project!
I'm currently writing some integration tests, using the docker image, and there seems to be something wrong with the mapping from
Object().NewReader.Using the Go example returns an
unable to create new reader: storage: object doesn't existerror.Looking at the Docker logs, it appears to be mapped to the wrong endpoint:
Note how the endpoint is
/test-bucket/some_file.txtwhereas other GET requests have/storage/v1/b/prefixed@simondrake commented on GitHub (May 7, 2020):
More information
I ran the docker image as described in the README:
And then ran the
main.gofile, exactly as is:@fsouza commented on GitHub (May 7, 2020):
Hi @simondrake, thanks for opening this issue. For the example to work, you need to start the server with a
-public-host:github.com/fsouza/fake-gcs-server@8a565dd691/ci/run-go-example.sh (L7)Perhaps we can add a comment to the example mentioning it?
@simondrake commented on GitHub (May 7, 2020):
Ahh right, ok. Yeah that works, thanks 👍 I didn't actually want/need the data volume for my tests, so that was definitely the missing piece.
I'll raise a PR shortly to add that to the documentation.
@simondrake commented on GitHub (May 7, 2020):
To save me going through the code - can you give me a quick explanation of what that does, and why it's needed when using
NewReader?@fsouza commented on GitHub (May 11, 2020):
Hi @simondrake, I apologize for not replying earlier. It seems that the go sdk uses an undocumented endpoint for downloading the file using the download host, which defaults to
storage.googleapis.com. The server is actually configured to serve downloads with that host/url, but it only works within Go tests when you use a client obtained from the server.For external access, you need to (1) teach the client to use a different download host (depends on the client) and (2) configure fake-gcs-server to serve the download handler in with that host (using the
-public-hostflag).I pushed a commit with a note on the Go example about providing the flag.
@anz-rfc commented on GitHub (May 25, 2020):
See also earlier issue https://github.com/fsouza/fake-gcs-server/issues/201