command: fix env var reader for HTTP addr
This commit is contained in:
parent
8ded1063db
commit
952fac6552
|
@ -43,7 +43,7 @@ func HTTPClient(addr string) (*consulapi.Client, error) {
|
||||||
// HTTPClientDC returns a new Consul HTTP client with the given address and datacenter
|
// HTTPClientDC returns a new Consul HTTP client with the given address and datacenter
|
||||||
func HTTPClientDC(addr, dc string) (*consulapi.Client, error) {
|
func HTTPClientDC(addr, dc string) (*consulapi.Client, error) {
|
||||||
conf := consulapi.DefaultConfig()
|
conf := consulapi.DefaultConfig()
|
||||||
if envAddr := os.Getenv("CONSUL_HTTP_ADDR"); addr != "" {
|
if envAddr := os.Getenv("CONSUL_HTTP_ADDR"); envAddr != "" {
|
||||||
addr = envAddr
|
addr = envAddr
|
||||||
}
|
}
|
||||||
conf.Address = addr
|
conf.Address = addr
|
||||||
|
|
Loading…
Reference in New Issue