Skip to content

Instantly share code, notes, and snippets.

@ayj
Created March 18, 2020 19:47
Show Gist options
  • Save ayj/22ed38ddf82dcd0021945f2e556cbfb7 to your computer and use it in GitHub Desktop.
Save ayj/22ed38ddf82dcd0021945f2e556cbfb7 to your computer and use it in GitHub Desktop.
diff --git a/pkg/mcp/source/client_source.go b/pkg/mcp/source/client_source.go
index 247474ff6..bac9b5936 100644
--- a/pkg/mcp/source/client_source.go
+++ b/pkg/mcp/source/client_source.go
@@ -19,6 +19,7 @@ import (
"io"
"time"
+ "github.com/gogo/protobuf/types"
"google.golang.org/grpc/codes"
mcp "istio.io/api/mcp/v1alpha1"
@@ -62,6 +63,20 @@ func (c *Client) sendTriggerResponse(stream Stream) error {
Collection: triggerCollection,
}
+ empty, err := types.MarshalAny(&types.Empty{})
+ if err != nil {
+ return err
+ }
+ for _, collection := range c.source.collections {
+ r := mcp.Resource{
+ Metadata: &mcp.Metadata{
+ Name: collection.Name,
+ },
+ Body: empty,
+ }
+ trigger.Resources = append(trigger.Resources, r)
+ }
+
if err := stream.Send(trigger); err != nil {
return status.Errorf(status.Code(err), "could not send trigger request %v", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment