register fix
This commit is contained in:
parent
0b035dfcc9
commit
ceaeecf1b4
@ -5,6 +5,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
consul "github.com/hashicorp/consul/api"
|
consul "github.com/hashicorp/consul/api"
|
||||||
@ -58,7 +59,7 @@ func (s *Service) GetFullAddr() string {
|
|||||||
func (s *Service) Register() error {
|
func (s *Service) Register() error {
|
||||||
def := &consul.AgentServiceRegistration{
|
def := &consul.AgentServiceRegistration{
|
||||||
ID: s.GetID(),
|
ID: s.GetID(),
|
||||||
Name: s.Name,
|
Name: strings.Replace(s.Name, "-", "_", -1),
|
||||||
Address: s.IP,
|
Address: s.IP,
|
||||||
Port: s.Port,
|
Port: s.Port,
|
||||||
Tags: s.getTags(),
|
Tags: s.getTags(),
|
||||||
|
Loading…
Reference in New Issue
Block a user