Trigger Resource Parameterization (k8s resource) - Is this good behaviour? #1205
ChaosInTheCRD
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
See how to configure default value at https://github.com/argoproj/argo-events/blob/master/docs/tutorials/02-parameterization.md#default-values. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a use case in the project I am working on, where we trigger a workflow from a sensor, from a k8s resource
CREATE
dependency. The k8s resource in question is a CRD.for example's sake we can call it
kind: Song
, with the following manifest picked up by the eventSource:In the sensor itself, if I set a parameter in a template trigger as follows:
and then a parameter for that trigger, outside the template:
Everything will work as expected. However - In the event that I was to create another resource of type
Song
, for example:In this instance the field
spec.genre.name
is not populated. For me, the expected behaviour was for the template parameter to stay as the value configured by default in the sensor (i.e.no-genre
) - However, it instead passes through the whole json body to the workflow, something like below:This is a little unhelpful in our case, as in the event that the field hasn't been populated (it's optional in the CRD), we want the sensor to back off to some default value.
Is this possible? But moreover, if it isn't; how so? A feature like this would be very helpful 😊
I was looking at this line in the Go code - Is that where it is set?
Hopefully this all made sense. And thanks for building such a great tool!
Beta Was this translation helpful? Give feedback.
All reactions