-
Notifications
You must be signed in to change notification settings - Fork 6
feat(events): improve parameter mapping for triggers #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,16 +12,13 @@ spec: | |
| workflow: | ||
| template: example-template | ||
| parameters: | ||
| - name: jpg | ||
| messagePath: body.parameters.jpg | ||
| - name: jpeg | ||
| messagePath: body.parameters.jpeg | ||
| - name: tif | ||
| messagePath: body.parameters.tif | ||
| jsonPath: parameters.tif | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realise that is was me that suggested changing the name of this. But I now realise this might be a little confusing. Even though the docs says JSONPath: https://argoproj.github.io/argo-events/APIs/ Apparently GJSON does not exactly implement the current JSONPath standard https://datatracker.ietf.org/doc/html/rfc9535. So it might be misleading to call this field JSONPath. Maybe your original was choice was better.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah right.. Do you think
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should decide. I don't have a strong opinion. I think as long as we document it well it doesn't really matter. It's alpha so we can change it if we see it confuses users. |
||
| - name: tiff | ||
| messagePath: body.parameters.tiff | ||
| jsonPath: parameters.tiff | ||
| - name: png | ||
| messagePath: body.parameters.png | ||
| jsonPath: parameters.png | ||
| default: "true" | ||
| --- | ||
| apiVersion: workflows.diamond.ac.uk/v1alpha1 | ||
| kind: Trigger | ||
|
|
@@ -37,7 +34,7 @@ spec: | |
| template: access-visit-dir | ||
| parameters: | ||
| - name: visitdir | ||
| messagePath: body.doc.data_session_directory | ||
| jsonPath: doc.data_session_directory | ||
|
|
||
| --- | ||
| apiVersion: workflows.diamond.ac.uk/v1alpha1 | ||
|
|
@@ -54,5 +51,5 @@ spec: | |
| template: echo-workflow-template | ||
| parameters: | ||
| - name: message | ||
| messagePath: body.name | ||
| jsonPath: name | ||
| {{- end }} | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if user sets "name" but not "jsonPath" what happens?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or vice versa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's enforced in the CRD that
nameis always required, plus at least one ofjsonPathanddefault