Change serf-tag references to field references.

This commit is contained in:
Derek Menteer 2022-08-31 16:38:42 -05:00
parent ce99ccd390
commit cf7f24a6ec
2 changed files with 23 additions and 28 deletions

View File

@ -1073,13 +1073,11 @@ func (s *Server) handleAliveMember(member serf.Member, nodeEntMeta *acl.Enterpri
}, },
} }
grpcPortStr := member.Tags["grpc_port"] if parts.ExternalGRPCPort > 0 {
if v, err := strconv.Atoi(grpcPortStr); err == nil && v > 0 { service.Meta["grpc_port"] = strconv.Itoa(parts.ExternalGRPCPort)
service.Meta["grpc_port"] = grpcPortStr
} }
grpcTLSPortStr := member.Tags["grpc_tls_port"] if parts.ExternalGRPCTLSPort > 0 {
if v, err := strconv.Atoi(grpcTLSPortStr); err == nil && v > 0 { service.Meta["grpc_tls_port"] = strconv.Itoa(parts.ExternalGRPCTLSPort)
service.Meta["grpc_tls_port"] = grpcTLSPortStr
} }
// Attempt to join the consul server // Attempt to join the consul server

View File

@ -33,11 +33,8 @@ type Server struct {
SegmentPorts map[string]int SegmentPorts map[string]int
WanJoinPort int WanJoinPort int
LanJoinPort int LanJoinPort int
// TODO why are these ports needed? It looks like nothing is referencing them.
ExternalGRPCPort int ExternalGRPCPort int
ExternalGRPCTLSPort int ExternalGRPCTLSPort int
Bootstrap bool Bootstrap bool
Expect int Expect int
Build version.Version Build version.Version