catalog_events: set the right key for connect snapshots

This commit is contained in:
Daniel Nephin 2020-12-03 19:45:12 -05:00
parent 410b1261c2
commit c33570be34
1 changed files with 11 additions and 4 deletions

View File

@ -71,11 +71,18 @@ func serviceHealthSnapshot(db ReadDB, topic stream.Topic) stream.SnapshotFunc {
event := stream.Event{
Index: idx,
Topic: topic,
Payload: EventPayloadCheckServiceNode{
Op: pbsubscribe.CatalogOp_Register,
Value: &n,
},
}
payload := EventPayloadCheckServiceNode{
Op: pbsubscribe.CatalogOp_Register,
Value: &n,
}
// TODO: share this logic with serviceHealthToConnectEvents
if connect && n.Service.Kind == structs.ServiceKindConnectProxy {
payload.key = n.Service.Proxy.DestinationServiceName
}
event.Payload = payload
if !connect {
// append each event as a separate item so that they can be serialized