-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support "IN" operator in govaluate statements #922
Comments
That seems... Strange. This feels more like a govaluate bug. Can we make sure that govaluate just doesn’t support arrays? |
That's definitively a bug in govaluate IMO (see Knetic/govaluate#79) but considering that we forked that package and that Eric's PR is still not merged, I would be tempted to say we need to either fix that with a custom function or by modifying govaluate itself to support that. |
We could just keep maintaining our fork and merge upstream changes into it over time. |
Additionally, I just realized we can't use a comma in the filter statements, in the current version of sensuctl, since we use them to separate statements, e.g.:
|
Can we change the way we input filters to not use commas to separate statements? |
Didn't find this issue when I previously searched and created a similar ticket. 😬 Copying over my investigation:
... I don't have a particularly strong opinion with regards to what is the best solution and open to any thoughts. |
I made a release of github.com/sensu/govaluate that fixes this issue. |
Closes #922 Signed-off-by: Eric Chlebek <[email protected]>
Closes #922 Signed-off-by: Eric Chlebek <[email protected]>
Closes #922 Signed-off-by: Eric Chlebek <[email protected]>
commit 9747e04 Merge: f6fc96d 7194168 Author: Nikki Attea <[email protected]> Date: Mon Jun 4 07:33:37 2018 -0700 Merge branch 'testing/metric-extraction' of https://github.com/sensu/sensu-go into testing/metric-extraction Signed-off-by: Nikki Attea <[email protected]> commit f6fc96d Author: Nikki Attea <[email protected]> Date: Fri Jun 1 10:50:46 2018 -0500 Remove metric extraction e2e test in favor of a more detailed integration test Signed-off-by: Nikki Attea <[email protected]> commit d6d1286 Author: Terrance Kennedy <[email protected]> Date: Fri Jun 1 14:46:27 2018 -0600 Travis: unshallow git history to detect version Signed-off-by: Terrance Kennedy <[email protected]> commit ca7a4b8 Author: Neal Granger <[email protected]> Date: Fri Jun 1 12:54:58 2018 -0700 Display a modal when authentication fails (#1627) In the event that automatic session refresh fails, show the user a message instead of redirecting directly to the sign in page. Signed-off-by: Neal Granger <[email protected]> commit ca88abe Author: Terrance Kennedy <[email protected]> Date: Fri Jun 1 13:52:42 2018 -0600 Remove tag info from deploy Signed-off-by: Terrance Kennedy <[email protected]> commit 04be123 Author: Terrance Kennedy <[email protected]> Date: Fri Jun 1 15:21:26 2018 -0400 Pass SENSU_BUILD_ITERATION to packaging container (#1641) Signed-off-by: Terrance Kennedy <[email protected]> ## What is this change? Passes the `SENSU_BUILD_ITERATION` environment variable into the sensu-go-build docker container when deploying packages. ## Why is this change necessary? Sensu nightly builds were broken on Travis because the version command could not determine the build iteration. ## Does your change need a Changelog entry? Not this time. ## Do you need clarification on anything? I'm good. ## Were there any complications while making this change? I noticed that the package_cloud gem was being installed on the host, which is unnecessary because it's only installed/used inside the sensu-go-build docker container. Builds should be a few seconds faster now too. commit be0a32d Author: Eric Chlebek <[email protected]> Date: Fri Jun 1 11:36:26 2018 -0700 Comment out failing tests. (#1639) These tests are failing on some environments, and we don't know why yet. Signed-off-by: Eric Chlebek <[email protected]> commit a59a476 Author: Nikki Attea <[email protected]> Date: Fri Jun 1 10:56:16 2018 -0500 Remove omitempty from boolean fields (#1632) Signed-off-by: Nikki Attea <[email protected]> commit 7194168 Author: Nikki Attea <[email protected]> Date: Fri Jun 1 10:50:46 2018 -0500 Remove metric extraction e2e test in favor of a more detailed integration test Signed-off-by: Nikki Attea <[email protected]> commit 318d489 Author: Eric Chlebek <[email protected]> Date: Thu May 31 11:19:40 2018 -0700 Upgrade govaluate to release 3.1.0. (#1629) Closes #922 Signed-off-by: Eric Chlebek <[email protected]> Signed-off-by: Nikki Attea <[email protected]>
At this moment, the
IN
operator can't be used in govaluate.For example, if I use the statement
"foo" in entity.Subscriptions
, govaluate will return:I believe it's because the value would need to be in the form of
("foo", "bar")
instead of[foo bar]
so we will probably need to create a custom function that users can call to support that format.The text was updated successfully, but these errors were encountered: