web: fix advertise address (#1608)
* web: fix advertise address * web: fix test Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> Co-authored-by: Asim Aslam <asim@aslam.me> Co-authored-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
f062013a7b
commit
d61df6363b
@ -63,7 +63,7 @@ func (s *service) genSrv() *registry.Service {
|
|||||||
// if it exists then use it, otherwise
|
// if it exists then use it, otherwise
|
||||||
// use the address
|
// use the address
|
||||||
if len(s.opts.Advertise) > 0 {
|
if len(s.opts.Advertise) > 0 {
|
||||||
host, port, err = net.SplitHostPort(s.opts.Address)
|
host, port, err = net.SplitHostPort(s.opts.Advertise)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal(err)
|
logger.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ func TestOptions(t *testing.T) {
|
|||||||
id = "service-id"
|
id = "service-id"
|
||||||
version = "service-version"
|
version = "service-version"
|
||||||
address = "service-addr:8080"
|
address = "service-addr:8080"
|
||||||
advertise = "service-adv"
|
advertise = "service-adv:8080"
|
||||||
reg = memory.NewRegistry()
|
reg = memory.NewRegistry()
|
||||||
registerTTL = 123 * time.Second
|
registerTTL = 123 * time.Second
|
||||||
registerInterval = 456 * time.Second
|
registerInterval = 456 * time.Second
|
||||||
|
Loading…
Reference in New Issue
Block a user