Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage endpoint as env var #707

Open
tarsisazevedo opened this issue Feb 11, 2021 · 3 comments
Open

Storage endpoint as env var #707

tarsisazevedo opened this issue Feb 11, 2021 · 3 comments
Labels
api: storage Issues related to the googleapis/java-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tarsisazevedo
Copy link

Is your feature request related to a problem? Please describe.
In order to test storage integration locally I need to setup host in StorageOption Builder by myself, like this:

final storageEndpoint = System.getenv("STORAGE_ENDPOINT");
StorageOption.newBuilder().setHost(storageEndpoint).build().getService();

Describe the solution you'd like
It can be easier and more time proof if StorageOption.DEFAULT_HOST use a env var to get it's value.

Describe alternatives you've considered
I think about something like this in StorageOptions class:

private static final String DEFAULT_HOST = System.getenv().getOrDefault("STORAGE_HOST", "https://storage.googleapis.com");

I can open a PR if you agree with this implementation or have any other idea.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Feb 11, 2021
@BenWhitehead BenWhitehead added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Feb 11, 2021
@BenWhitehead
Copy link
Collaborator

@frankyn Do you know if anything similar to this is done for any of the other clients?

@frankyn
Copy link
Member

frankyn commented Feb 11, 2021

We have it in the Node.js, Go, and Python storage clients, but it's not necessarily "official".

It was started a side project for performance benchmarking.

Maybe it's time to help make these official across libraries at this point. There are quirks that need to be ironed out a bit more though.

@tritone
Copy link
Contributor

tritone commented Feb 12, 2021

This has definitely been a source of confusion and bugs in the Go library, so it has to be done carefully. I do think it's a good idea to be consistent about env var naming and how this is supported across libraries though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants