File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import "github.com/spf13/viper"
44
55func Load () {
66 viper .AutomaticEnv ()
7- viper .SetDefault ("ENVOY_HOST" , "http://0 .0.0.0 :19001" )
7+ viper .SetDefault ("ENVOY_HOST" , "http://127 .0.0.2 :19001" )
88 viper .SetDefault ("CONSUL_API_HOST" , "http://0.0.0.0:8500" )
99 viper .SetDefault ("NOMAD_ADDR" , "https://0.0.0.0:4646" )
1010}
Original file line number Diff line number Diff line change 88func TestConfig_Load (t * testing.T ) {
99 Load ()
1010 eh := viper .GetString ("ENVOY_HOST" )
11- if eh != "http://0 .0.0.0 :19001" {
11+ if eh != "http://127 .0.0.2 :19001" {
1212 t .Error ("Default ENVOY_HOST is incorrect:" , eh )
1313 }
1414 eh = viper .GetString ("CONSUL_API_HOST" )
Original file line number Diff line number Diff line change 77
88func TestGetDefaultHost (t * testing.T ) {
99 t .Run ("Test GetHost == ENVOY_HOST" , func (t * testing.T ) {
10- testAddr := "http://0 .0.0.0 :19000"
10+ testAddr := "http://127 .0.0.2 :19000"
1111 viper .Set ("ENVOY_HOST" , testAddr )
1212 if GetDefaultHost () != testAddr {
1313 t .Error ("ENVOY_HOST does not match" )
You can’t perform that action at this time.
0 commit comments