From 75a4a1c7aa529c24dbfccc2ede2c1ab0e5b9d465 Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Fri, 31 Jul 2020 08:55:08 +0100 Subject: [PATCH] Fix proxy being overriden by default addresses (#1886) --- registry.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/registry.go b/registry.go index 5a6db4d..3331749 100644 --- a/registry.go +++ b/registry.go @@ -188,8 +188,14 @@ func (r *rtr) fetchRoutes(service string) error { for _, srv := range services { var domain string + + // since a wildcard query was performed, the service could belong + // to one of many namespaces, to get this information we check + // the node metadata. TODO: Add Domain to registry.Service if srv.Metadata != nil && len(srv.Metadata["domain"]) > 0 { domain = srv.Metadata["domain"] + } else if len(srv.Nodes) > 0 && srv.Nodes[0].Metadata != nil { + domain = srv.Nodes[0].Metadata["domain"] } else { domain = registry.WildcardDomain }