Bugfix: Set gateway to node.Address
gw has not been initialized; it was basically an empty string and only got populated by Sprintf-ing the addr:port IF the port has been set. This commit sets the gw to node.Address to it's never an empty string.
This commit is contained in:
parent
27b145f968
commit
76011b151d
@ -108,7 +108,7 @@ func (r *router) addServiceRoutes(reg registry.Registry, network string, metric
|
|||||||
// add each service node as a separate route;
|
// add each service node as a separate route;
|
||||||
for _, service := range services {
|
for _, service := range services {
|
||||||
for _, node := range service.Nodes {
|
for _, node := range service.Nodes {
|
||||||
var gw string
|
gw := node.Address
|
||||||
if node.Port > 0 {
|
if node.Port > 0 {
|
||||||
gw = fmt.Sprintf("%s:%d", node.Address, node.Port)
|
gw = fmt.Sprintf("%s:%d", node.Address, node.Port)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user