fabiolb / fabio

Consul Load-Balancing made simple
https://fabiolb.net
MIT License
7.25k stars 621 forks source link

Allow Consul api to set default config for addr #829

Open pingiun opened 3 years ago

pingiun commented 3 years ago

As can be seen in https://github.com/hashicorp/consul/blob/91ee7990ccf27ab7fccff746f8df0df65c3c583d/api/api.go#L390 the API also defaults to localhost:8500, however it can also use the environment variable CONSUL_HTTP_ADDR which is useful when fabio is run with nomad.

This change makes sure that the existing default stays working, but it now works better by default in more situations

Related: #773

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

nathanejohnson commented 2 years ago

@pingiun I think this is a good change, sorry this has taken so long to get back to you. But if you can get this rebased against master, i'll try to sneak this in with the next release which will likely happy tomorrow.

pingiun commented 2 years ago

@nathanejohnson good to hear! I switched from fabio to traefik myself but I'm happy to help out

nathanejohnson commented 2 years ago

So the config load tests are failing, I will have to postpone this for a bit when I have more time to dig in, but I believe it's in the parseScheme method for parsing the consul address.