-
Notifications
You must be signed in to change notification settings - Fork 749
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
Allow for JSON string to be processed in the Sensor DataFilter #1097
Labels
enhancement
New feature or request
Comments
Issue resolved with PR |
tico24
added a commit
to tico24/argo-events
that referenced
this issue
Mar 24, 2021
Signed-off-by: Tim Collins <[email protected]>
tico24
added a commit
to tico24/argo-events
that referenced
this issue
Mar 24, 2021
Signed-off-by: Tim Collins <[email protected]>
whynowy
pushed a commit
that referenced
this issue
Mar 24, 2021
* docs: Enhance the filters tutorial for #1097 Signed-off-by: Tim Collins <[email protected]>
whynowy
pushed a commit
that referenced
this issue
Mar 24, 2021
* docs: Enhance the filters tutorial for #1097 Signed-off-by: Tim Collins <[email protected]>
juliev0
pushed a commit
to juliev0/argo-events
that referenced
this issue
Mar 29, 2022
* docs: Enhance the filters tutorial for argoproj#1097 Signed-off-by: Tim Collins <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
When using gjson to evaluate the path of the DataFilter it returns a
Result
. You are usingResult.Str
here. With gjson you can return a JSON object by utilizing a Multipath. However, when utilizing this Multipath theResult.Type
is JSON and thus theResult.Str
returns an empty string and nothing is ever matched by the filter. You can however callResult.String()
which correctly returns the string based on theResult.Type
.Describe the solution you'd like
A clear and concise description of what you want to happen.
What I'm trying to achieve is I have a webhook defined for an event and I want to filter the calls based on a value and depending on that value I may or may not want to filter if another value is something. For example:
I want the sensor to fire if my action is "opened" and it has a label of "Webhook" or if the action is "closed" and it has a label of "Webhook" and "Approved". Given the value of the DataFilter can be a regex I can use the gjson syntax to do something like:
This produces a String like this:
Then I could do a regex with something like:
To filter the way I want. However, like I mentioned above the
Result.Str
is empty when theResult.Type
is JSON and thus would need to code changed to callResult.String()
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I tried I ton of different ways to filter based on what I want but can't come up with anything else.
Additional context
Add any other context or screenshots about the feature request here.
Message from the maintainers:
If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
The text was updated successfully, but these errors were encountered: