register fix

This commit is contained in:
Piotr Biernat 2022-12-01 19:43:35 +01:00
parent 0b035dfcc9
commit ceaeecf1b4

View File

@ -5,6 +5,7 @@ import (
"log"
"net/http"
"strconv"
"strings"
"time"
consul "github.com/hashicorp/consul/api"
@ -58,7 +59,7 @@ func (s *Service) GetFullAddr() string {
func (s *Service) Register() error {
def := &consul.AgentServiceRegistration{
ID: s.GetID(),
Name: s.Name,
Name: strings.Replace(s.Name, "-", "_", -1),
Address: s.IP,
Port: s.Port,
Tags: s.getTags(),