From 5bf58aad1616f3415fac09c268b4ebb6f10f44a7 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 1 Dec 2022 20:26:22 +0100 Subject: [PATCH] register fix --- consul/discovery.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consul/discovery.go b/consul/discovery.go index 413b371..20499b0 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -120,7 +120,8 @@ func (s *Service) check() (bool, error) { func (s *Service) getMetadata() map[string]string { m := map[string]string{} - m["traefik/http/services/"+s.Name+"/loadBalancer/servers/0/url"] = s.GetFullAddr() + key := fmt.Sprintf("traefik/http/services/%s/loadBalancer/servers/0/url", s.Name) + m[key] = s.GetFullAddr() fmt.Printf("netadata: %v", m)