Max Goncharenko
9da2d44ee1
Fix #1737 : forceMutate does not handle StrategicMerge patchesJson6902 ( #1775 )
...
* Fix #1737 : forceMutate does not handle StrategicMerge patchesJson6902
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* go fmt
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* updated PR due to the comments
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-28 13:12:44 -07:00
Max Goncharenko
6a0305674a
JMESPath custom functions ( #1772 )
...
* JMESPath: Support regex expressions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* JMESPath: Add string functions
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Removed {{$}} variable handling logic
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Name all functions in snake case; Update error message; Fix {{@}} behavior
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-16 16:17:00 -07:00
shuting
f515bc5dbf
skip rule application if referred path not exist ( #1806 )
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-04-15 17:33:34 -07:00
shuting
081244a102
Fix array variables substitution ( #1800 )
...
* fix array variables substitution
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* Add ability to marshal complex vars to string
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* Added tests for variable substitution
Signed-off-by: Max Goncharenko <kacejot@fex.net>
Co-authored-by: Max Goncharenko <kacejot@fex.net>
2021-04-14 13:09:00 -07:00
Max Goncharenko
8050c4e77b
moved variable substitution to higher level to avoid unhandled cases ( #1785 )
...
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-13 11:44:43 -07:00
Max Goncharenko
01004e1db0
Fix #1754 Invalid variable validation ( #1770 )
...
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-04-06 10:56:06 -07:00
Jim Bugwadia
3cffc3654a
Merge pull request #1762 from realshuting/1757_default_image_info
...
Set default image registry and tag if not present
2021-04-01 13:40:13 -07:00
Shuting Zhao
1cf8efd472
set default image registry and tag if not present
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-04-01 09:50:34 -07:00
Shuting Zhao
cab81eadda
operate on the copy of configmap data
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-31 15:22:25 -07:00
Shuting Zhao
4d01f76797
- fix variable validation; - update log level
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-31 13:24:36 -07:00
Jim Bugwadia
f29f6b0369
add comment
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-26 10:47:59 -07:00
Jim Bugwadia
908950c47a
address comments
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 21:27:16 -07:00
Jim Bugwadia
72cdbafbae
fix tests
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 18:11:32 -07:00
Jim Bugwadia
8d03f8c59e
merge main
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 18:00:02 -07:00
Jim Bugwadia
6dff9e0ab9
merge and resolve conflicts
...
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2021-03-25 16:43:12 -07:00
Jim Bugwadia
4d70013e22
Merge pull request #1724 from MarcelMue/fix-apipath-validation
...
Make validateAPICall work with special characters in variables
2021-03-24 22:28:09 -07:00
shuting
c08843ef77
Add Images info to variables context ( #1725 )
...
* - remove supportMutateValidate; - refactor new context in the webhook
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* add ImageInfo to variables context
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* revert unexpected changes
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-23 10:34:03 -07:00
Shuting Zhao
d650d2b609
fixes variable substitution in context.apiCall.jmesPath
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-22 12:15:29 -07:00
Pooja Singh
4128410207
Enhancement/existence anchor - should loop all the items in the array ( #1719 )
...
* updated validating policy code
Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
* changed existance logic to loop all the items in array
Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
* updated comments and error messages
Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
2021-03-19 15:18:26 -07:00
Max Goncharenko
3373a79f26
Bug Fix : #1585 issue; validate on DELETE the oldResource ( #1710 )
...
* fix #1585 issue; validate on DELETE the oldResource
Signed-off-by: Max Goncharenko <kacejot@fex.net>
* apply PR edits for #1585 issue fix; add test with nested var
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-03-19 14:43:26 -07:00
Marcel Mueller
4f96232e62
Make validateAPICall work with special characters in variables
...
Signed-off-by: Marcel Mueller <marcel.mueller1@rwth-aachen.de>
2021-03-19 20:29:55 +01:00
Shuting Zhao
7502e5da98
fix variable substitution in NumericOperatorHandler
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-18 13:40:14 -07:00
Joshua Snider
6699bfab8c
Fix tests
...
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
2021-03-16 15:00:42 -04:00
Joshua Snider
9377f70840
Change isNotIn
...
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
2021-03-16 14:26:41 -04:00
Jim Bugwadia
ff4fb41bdf
Merge pull request #1680 from jsnider-mtu/bug/groupVersion-in-api-path
...
Bug Fix #1679 ; Set Version to Group/Version for /apis/* URLs
2021-03-16 08:43:44 -07:00
Max Goncharenko
24c4f06ecd
Fix #1506 ; Resolve path reference in entire rule instead of just pattern/overlay
...
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-03-16 13:45:40 +02:00
Max Goncharenko
db49046e26
fix #1465 : raise log level to error; add failed rules ( #1709 )
...
Signed-off-by: Max Goncharenko <kacejot@fex.net>
2021-03-15 15:34:21 -07:00
Arsh Sharma
1dfcef1cc8
fix: changed logic for In and NotIn for sets ( #1704 )
...
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-03-15 12:59:24 -07:00
shuting
70d90ffb06
- remove preProcessJSONPatches; - update local Dockerfile ( #1703 )
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-03-15 10:29:46 -07:00
Jim Bugwadia
bb361df696
Merge pull request #1597 from yashvardhan-kukreja/issue-1242/multiline-yaml-string-support
...
feat: added functionality for delimiting multi-line block by newline characters
2021-03-10 09:58:38 -08:00
Joshua Snider
b0fd2403e8
Add unit test
...
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
2021-03-08 22:56:14 -05:00
Joshua Snider
23149738df
Set Version to Group/Version for /apis/* URLs
...
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
2021-03-06 00:22:12 -05:00
jsnider-mtu
81b147e279
Replace spaces with tabs
...
Signed-off-by: jsnider-mtu <jsnider@mtu.edu>
2021-03-05 14:13:00 -05:00
jsnider-mtu
b86342c097
Fix API path
...
Signed-off-by: jsnider-mtu <jsnider@mtu.edu>
2021-03-05 14:05:12 -05:00
Vyankatesh Kudtarkar
9e831ec959
Bug Fix: Extends match / exclude to use apiGroup and apiVersion ( #1218 ) ( #1656 )
...
* Extends match / exclude to use apiGroup and apiVersion
Signed-off-by: vyankatesh <vyankatesh@neualto.com>
* fix gvk issue
Signed-off-by: vyankatesh <vyankatesh@neualto.com>
Co-authored-by: vyankatesh <vyankatesh@neualto.com>
2021-03-04 16:45:52 -08:00
Yashvardhan Kukreja
10c714d5ba
feat: [preconditions, conditions] added backwards-compatible support for logical operators ( #1604 )
...
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-03-01 20:31:06 -08:00
Yashvardhan Kukreja
ca347b27bf
feat: added functionality for delimiting multi-line block by newline characters
...
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-03-01 00:46:50 +05:30
Arsh Sharma
86879bd267
feat(operators): supporting subset checking ( #1613 )
...
* fix(operators): supporting subset checking
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): removed print statement
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* test(operators): added test file for in
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): fixed switching
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* tests(operators): completed tests for In and NotIn
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* chore(operators): code cleanup
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* chore(operators): added comments for tests
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* fix(operators): changed logic based on new definitions
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* test: updated NotIn tests
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-02-26 10:53:54 -08:00
Jim Bugwadia
0d1f0b5897
Merge pull request #1636 from realshuting/1621_fix_configmap_variables
...
Substitute variables in context.configMap
2021-02-25 19:53:11 -08:00
Shuting Zhao
7795f335c8
fix negative index
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-25 18:36:13 -08:00
Shuting Zhao
517c60fadc
add unit tests
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-25 18:02:52 -08:00
Shuting Zhao
c4ebef7b0d
- support AllowMissingPathOnRemove and EnsurePathExistsOnAdd in patchesJSON6902
...
- upgrade to evanphx/json-patch/v5
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-25 15:25:07 -08:00
Shuting Zhao
492d0e8009
remove kustomize patchesJSON6902
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-25 15:25:07 -08:00
Shuting Zhao
d770d6680b
add request.namespace in the background process
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 17:22:23 -08:00
Shuting Zhao
17c72c1578
substitute variables in context.configMap
...
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 16:27:20 -08:00
shuting
267be0815f
Bug fixes - policy validation, auto-generated rules, apiCall support in mutate and generate ( #1629 )
...
* Fix invalid policy reports generated for blocked resource
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1464 - copy context and preconditions to auto-gen rules
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1628 - add policy validations
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix 1593 - support apiCall in mutate and generate
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix test
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-22 12:08:26 -08:00
Arsh Sharma
596bc9ba6f
feat(operators): support subset checking for in and notin ( #1555 )
...
* feat(operators): support subset checking for in and notin
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
* feat(operators): fixed NotIn function
Signed-off-by: Arsh Sharma <arshsharma461@gmail.com>
2021-02-10 13:05:36 -08:00
Pooja Singh
c148573d48
issue fixed ( #1558 )
...
Signed-off-by: NoSkillGirl <singhpooja240393@gmail.com>
2021-02-08 10:36:39 -08:00
shuting
2f2d6c2e38
Upgrade client libraries to 0.20.2 ( #1547 )
...
* upgrade clients to 0.20.2
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* remove debug log
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix unit tests
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
* fix e2e test
Signed-off-by: Shuting Zhao <shutting06@gmail.com>
2021-02-07 20:26:56 -08:00
Yashvardhan Kukreja
6b3ab3fe23
added: generic NumericOperator to handle numeric operations for kyverno policies ( #1536 )
...
Signed-off-by: Yashvardhan Kukreja <yash.kukreja.98@gmail.com>
2021-02-05 19:49:23 -08:00