From 45278cb69e564b4e05ab964bc41cd799b20f6de1 Mon Sep 17 00:00:00 2001 From: cskh Date: Tue, 11 Oct 2022 10:56:29 -0400 Subject: [PATCH] fix(peering): add missing grpc_tls_port for server address reconciliation (#14944) --- agent/consul/autopilotevents/ready_servers_events.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agent/consul/autopilotevents/ready_servers_events.go b/agent/consul/autopilotevents/ready_servers_events.go index 6e7734fee..862959a12 100644 --- a/agent/consul/autopilotevents/ready_servers_events.go +++ b/agent/consul/autopilotevents/ready_servers_events.go @@ -310,6 +310,14 @@ func (r *ReadyServersEventPublisher) getGRPCPort(srv *autopilot.ServerState) int if err != nil || ns == nil || ns.Meta == nil { return 0 } + + if str, ok := ns.Meta["grpc_tls_port"]; ok { + grpcPort, err := strconv.Atoi(str) + if err == nil { + return grpcPort + } + } + if str, ok := ns.Meta["grpc_port"]; ok { grpcPort, err := strconv.Atoi(str) if err == nil {