diff --git a/agent/consul/state/catalog_events.go b/agent/consul/state/catalog_events.go index bcdcf227ab..b7fc6118d0 100644 --- a/agent/consul/state/catalog_events.go +++ b/agent/consul/state/catalog_events.go @@ -24,6 +24,7 @@ type EventPayloadCheckServiceNode struct { // events in the connect topic to specify the name of the underlying service // when the change event is for a sidecar or gateway. key string + // FIXME: we need to be able to override the namespace for some terminating gateway events } func (e EventPayloadCheckServiceNode) HasReadPermission(authz acl.Authorizer) bool { @@ -454,9 +455,10 @@ func copyEventForService(event stream.Event, service structs.ServiceName) stream event.Topic = topicServiceHealthConnect payload := event.Payload.(EventPayloadCheckServiceNode) payload.key = service.Name - event.Payload = payload // FIXME: we need payload to have an override for namespace, so that it can be filtered // properly by EventPayloadCheckServiceNode.MatchesKey + // payload.enterpriseMeta = service.EnterpriseMeta + event.Payload = payload return event } diff --git a/agent/consul/state/catalog_events_test.go b/agent/consul/state/catalog_events_test.go index 17139ba82d..e2f776c856 100644 --- a/agent/consul/state/catalog_events_test.go +++ b/agent/consul/state/catalog_events_test.go @@ -1196,7 +1196,7 @@ var cmpPartialOrderEvents = cmp.Options{ cmpopts.SortSlices(func(i, j stream.Event) bool { key := func(e stream.Event) string { csn := getPayloadCheckServiceNode(e.Payload) - return fmt.Sprintf("%s/%s/%s", e.Topic, csn.Node.Node, csn.Service.Service) + return fmt.Sprintf("%s/%s/%s/%s", e.Topic, csn.Node.Node, csn.Service.Service, e.Payload.(EventPayloadCheckServiceNode).key) } return key(i) < key(j) }),