Skip to content

Commit

Permalink
backport of commit 28286a2
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayraghav-io committed Jun 29, 2023
1 parent 1ac9d3a commit 9be133a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions agent/consul/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,13 @@ AFTER_CHECK:
"partition", getSerfMemberEnterpriseMeta(member).PartitionOrDefault(),
)

// Get consul version from serf member
// add this as node meta in catalog register request
buildVersion, err := metadata.Build(&member)
if err != nil {
return err
}

// Register with the catalog.
req := structs.RegisterRequest{
Datacenter: s.config.Datacenter,
Expand All @@ -1102,6 +1109,9 @@ AFTER_CHECK:
Output: structs.SerfCheckAliveOutput,
},
EnterpriseMeta: *nodeEntMeta,
NodeMeta: map[string]string{
structs.MetaConsulVersion: buildVersion.String(),
},
}
if node != nil {
req.TaggedAddresses = node.TaggedAddresses
Expand Down

0 comments on commit 9be133a

Please sign in to comment.