1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/pkg/engine/jmespath
Andreas Brehmer a1ae86cdbe
Add JMESPath function for dynamic object/array lookup (#7136)
* Fix JMESPath functions error message

JMESPath functions `parse_yaml`, `items` and `object_from_lists` use
wrong format string arguments for an error message and count the
argument from 0 instead of 1.

Fix the format string args and add 1 to the argument index.

Also improve the error message itself.

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>

* Add JMESPath function `lookup`

`lookup` allows for dynamic lookups of objects and arrays, i.e. where
the key/index to look up is determined during the JMESPath query and
thus cannot be injected upfront.

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>

---------

Signed-off-by: Andreas Brehmer <andreas.brehmer@sap.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-06-19 13:45:13 +00:00
..
arithmetic.go refactor: introduce jmespath interface (#6882) 2023-04-13 11:29:40 +00:00
arithmetic_test.go feat: add image_normalize filter (#6911) 2023-04-13 16:13:40 +00:00
error.go Add JMESPath function for dynamic object/array lookup (#7136) 2023-06-19 13:45:13 +00:00
functionentry.go chore: add a few unit tests for jp functions (#6219) 2023-02-06 06:27:27 +00:00
functionentry_test.go chore: add a few unit tests for jp functions (#6219) 2023-02-06 06:27:27 +00:00
functions.go Add JMESPath function for dynamic object/array lookup (#7136) 2023-06-19 13:45:13 +00:00
functions_test.go Add JMESPath function for dynamic object/array lookup (#7136) 2023-06-19 13:45:13 +00:00
interface.go feat: add image_normalize filter (#6911) 2023-04-13 16:13:40 +00:00
new.go feat: add image_normalize filter (#6911) 2023-04-13 16:13:40 +00:00
new_test.go feat: add image_normalize filter (#6911) 2023-04-13 16:13:40 +00:00
time.go feat: add more time jmespath filters (#5950) 2023-01-10 04:40:46 +00:00
time_test.go feat: add image_normalize filter (#6911) 2023-04-13 16:13:40 +00:00
utils.go Add JMESPath function for dynamic object/array lookup (#7136) 2023-06-19 13:45:13 +00:00
utils_test.go Add JMESPath function for dynamic object/array lookup (#7136) 2023-06-19 13:45:13 +00:00