diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 47f92fed44..12ed9a1a04 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ Argo Events is native to Kubernetes so you'll need a running Kubernetes cluster. ### Requirements - Golang 1.12 - Docker -- dep +- [dep](https://golang.github.io/dep/docs/installation.html) ### Installation & Setup @@ -32,6 +32,7 @@ cd $GOPATH/src/github.com/argoproj/argo-events #### 2. Vendor dependencies ``` +GO111MODULE=on go get github.com/cloudevents/sdk-go dep ensure -vendor-only ``` diff --git a/sensors/triggers/params.go b/sensors/triggers/params.go index 02eba6fd4f..9f986b51f3 100644 --- a/sensors/triggers/params.go +++ b/sensors/triggers/params.go @@ -35,7 +35,7 @@ import ( // ConstructPayload constructs a payload for operations involving request and responses like HTTP request. func ConstructPayload(sensor *v1alpha1.Sensor, parameters []v1alpha1.TriggerParameter) ([]byte, error) { - payload := make(map[string]string) + var payload []byte events := ExtractEvents(sensor, parameters) if events == nil { @@ -47,10 +47,14 @@ func ConstructPayload(sensor *v1alpha1.Sensor, parameters []v1alpha1.TriggerPara if err != nil { return nil, err } - payload[parameter.Dest] = value + tmp, err := sjson.SetBytes(payload, parameter.Dest, value) + if err != nil { + return nil, err + } + payload = tmp } - return json.Marshal(payload) + return payload, nil } // ApplyTemplateParameters applies parameters to trigger template