googleapis / googleapis/google-cloud-java

[java-storage] Storage endpoint as env var

Open
#12,650 3 comments 0 reactions 0 assignees View on GitHub
api: storage type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

**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:

```java
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:
```java
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.