Merge pull request #8893 from hashicorp/dnephin/add-steps-to-subscribe-tests

subscribe: add steps to long test cases, and add new cases for converting Events
pull/8909/head
Daniel Nephin 4 years ago committed by GitHub
commit 0d653b184b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -83,7 +83,7 @@ func (h *Server) Subscribe(req *pbsubscribe.SubscribeRequest, serverStream pbsub
}
elog.Trace(event)
e := newEventFromStreamEvent(req, event)
e := newEventFromStreamEvent(req.Topic, event)
if err := serverStream.Send(e); err != nil {
return err
}
@ -139,10 +139,10 @@ func filterByAuth(authz acl.Authorizer, event stream.Event) (stream.Event, bool)
return event.Filter(fn)
}
func newEventFromStreamEvent(req *pbsubscribe.SubscribeRequest, event stream.Event) *pbsubscribe.Event {
func newEventFromStreamEvent(topic pbsubscribe.Topic, event stream.Event) *pbsubscribe.Event {
e := &pbsubscribe.Event{
Topic: req.Topic,
Key: req.Key,
Topic: topic,
Key: event.Key,
Index: event.Index,
}
switch {

File diff suppressed because it is too large Load Diff

@ -5,9 +5,10 @@ import (
"fmt"
"regexp"
"github.com/hashicorp/consul/agent/structs"
"github.com/hashicorp/go-msgpack/codec"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/consul/agent/structs"
)
const (

Loading…
Cancel
Save