mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #711] Usage with testContainers-go #120
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#120
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 @majelbstoat on GitHub (Mar 10, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/711
I'm trying to programmatically start fake-gcs-server using testcontainers-go. Example:
As with other folks, I can
curl --insecure http://localhost:XXXX/storage/v1/b/sample-bucket/oand see my files in there, whereXXXXis the mapped external port, but I can't retrieve them using the storage client.From other issues, I believe this is because I'm not setting a public host. My problem is, I don't know what the full public host will be until after the container starts, because that's when I get the mapped port.
As others have note,
-public-host 0.0.0.0and-public-host localhostdon't work, so I have this circular dependency which I can't figure out how to break.@fsouza commented on GitHub (Mar 10, 2022):
@sergseven recently added an internal endpoint for updating some configuration parameters, aimed specifically at setting the external URL after starting the container with test containers, you can see a Java example in his PR: https://github.com/fsouza/fake-gcs-server/pull/659#issue-1114081250
Let me know if that's enough information is enough for you.
We should probably document that endpoint in the README at some point.
@majelbstoat commented on GitHub (Mar 10, 2022):
So, that looks like it might be helpful, thanks! But, at the moment, it looks like it can only be used to change the ExternalUrl.
https://github.com/fsouza/fake-gcs-server/blob/main/fakestorage/config.go
I can submit a patch for changing the public host, if that's acceptable?
@fsouza commented on GitHub (Mar 10, 2022):
@majelbstoat ohh sorry I misread your message. Yeah, that's acceptable, feel free to send the PR adding support for overriding the public host!
@majelbstoat commented on GitHub (Mar 10, 2022):
Cool, PR here: https://github.com/fsouza/fake-gcs-server/pull/712 :)