diff --git a/Makefile b/Makefile index 28d8f2371..b96b9d80c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.0.44 +VERSION=v0.0.45 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/runtime.go b/cmd/commands/runtime.go index 358cdab4d..e6798576c 100644 --- a/cmd/commands/runtime.go +++ b/cmd/commands/runtime.go @@ -537,7 +537,7 @@ func createEventsReporter(ctx context.Context, cloneOpts *git.CloneOptions, opts return err } - if err := createSensor(repofs, store.Get().EventsReporterName, resPath, opts.RuntimeName, store.Get().EventsReporterName, "events"); err != nil { + if err := createSensor(repofs, store.Get().EventsReporterName, resPath, opts.RuntimeName, store.Get().EventsReporterName, "events", "data"); err != nil { return err } @@ -571,7 +571,7 @@ func createWorkflowReporter(ctx context.Context, cloneOpts *git.CloneOptions, op return err } - if err := createSensor(repofs, store.Get().WorkflowReporterName, resPath, opts.RuntimeName, store.Get().WorkflowReporterName, "workflows"); err != nil { + if err := createSensor(repofs, store.Get().WorkflowReporterName, resPath, opts.RuntimeName, store.Get().WorkflowReporterName, "workflows", "data.object"); err != nil { return err } @@ -738,7 +738,7 @@ func createWorkflowReporterEventSource(repofs fs.FS, path, namespace string) err return repofs.WriteYamls(repofs.Join(path, "event-source.yaml"), eventSource) } -func createSensor(repofs fs.FS, name, path, namespace, eventSourceName, trigger string) error { +func createSensor(repofs fs.FS, name, path, namespace, eventSourceName, trigger, dataKey string) error { sensor := eventsutil.CreateSensor(&eventsutil.CreateSensorOptions{ Name: name, Namespace: namespace, @@ -746,6 +746,7 @@ func createSensor(repofs fs.FS, name, path, namespace, eventSourceName, trigger EventBusName: store.Get().EventBusName, TriggerURL: cfConfig.GetCurrentContext().URL + store.Get().EventReportingEndpoint, Triggers: []string{trigger}, + TriggerDestKey: dataKey, }) return repofs.WriteYamls(repofs.Join(path, "sensor.yaml"), sensor) } diff --git a/docs/releases/release_notes.md b/docs/releases/release_notes.md index 8c3e4568e..b6315bc7c 100644 --- a/docs/releases/release_notes.md +++ b/docs/releases/release_notes.md @@ -8,7 +8,7 @@ ### Linux ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.44/cf-linux-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.45/cf-linux-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-linux-amd64 /usr/local/bin/cf @@ -20,7 +20,7 @@ cf version ### Mac ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.44/cf-darwin-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.0.45/cf-darwin-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-darwin-amd64 /usr/local/bin/cf diff --git a/manifests/runtime.yaml b/manifests/runtime.yaml index 43209c6de..7ee83511b 100644 --- a/manifests/runtime.yaml +++ b/manifests/runtime.yaml @@ -5,7 +5,7 @@ metadata: namespace: "{{ namespace }}" spec: defVersion: 1.0.0 - version: 0.0.44 + version: 0.0.45 bootstrapSpecifier: github.com/codefresh-io/cli-v2/manifests/argo-cd components: - name: events diff --git a/pkg/util/events/util.go b/pkg/util/events/util.go index 4914fe370..7c233843a 100644 --- a/pkg/util/events/util.go +++ b/pkg/util/events/util.go @@ -70,12 +70,14 @@ type ( EventBusName string TriggerURL string Triggers []string + TriggerDestKey string } - CreateTriggerOptions struct { + createTriggerOptions struct { Conditions string URL string DependencyName string + DataDestKey string } ) @@ -187,10 +189,11 @@ func CreateSensor(opts *CreateSensorOptions) *sensorsv1alpha1.Sensor { EventSourceName: opts.EventSourceName, EventName: trigger, }) - triggers[i] = *CreateTrigger(&CreateTriggerOptions{ + triggers[i] = *createTrigger(&createTriggerOptions{ Conditions: trigger, URL: opts.TriggerURL, DependencyName: trigger, + DataDestKey: opts.TriggerDestKey, }) } @@ -214,7 +217,7 @@ func CreateSensor(opts *CreateSensorOptions) *sensorsv1alpha1.Sensor { } } -func CreateTrigger(opts *CreateTriggerOptions) *sensorsv1alpha1.Trigger { +func createTrigger(opts *createTriggerOptions) *sensorsv1alpha1.Trigger { return &sensorsv1alpha1.Trigger{ Template: &sensorsv1alpha1.TriggerTemplate{ Conditions: opts.Conditions, @@ -244,7 +247,7 @@ func CreateTrigger(opts *CreateTriggerOptions) *sensorsv1alpha1.Trigger { DependencyName: opts.DependencyName, DataKey: "body", }, - Dest: "data.object", + Dest: opts.DataDestKey, }, }, },