1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
Commit graph

3216 commits

Author SHA1 Message Date
Charles-Edouard Brétéché
a6d6282b90
fix: improve config management (#6808)
* fix: improve config logs

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* notification

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-06 19:13:32 +00:00
Charles-Edouard Brétéché
58d4d3c28a
fix: add logs in webhook middlewares (#6797) 2023-04-06 14:28:13 +00:00
Charles-Edouard Brétéché
de00c78513
refactor: simplify engine responses (#6804)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 22:55:42 +00:00
Charles-Edouard Brétéché
166122b0ea
refactor: engine response stats (#6796)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-06 01:07:04 +08:00
Charles-Edouard Brétéché
5ec66918f6
feat: add subresource support to resource filters (#6780)
* feat: add subresource support to resource filters

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* filter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* values

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 13:51:07 +00:00
Charles-Edouard Brétéché
efde33c816
fix: drop hardcoded default exclusions (#6789)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 13:05:04 +00:00
Charles-Edouard Brétéché
ab8639b643
refactor: engine execution stats (#6792)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 12:27:18 +00:00
Charles-Edouard Brétéché
a710cccb7a
fix: replace background sa name in config by a flag (#6790)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 11:50:29 +00:00
Charles-Edouard Brétéché
784ca07419
refactor: engine rule response creation (#6784)
* refactor: engine rule response creation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* private fields

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more private

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 10:35:38 +00:00
Charles-Edouard Brétéché
6f8ef4fd30
fix: histogram buckets (#6783)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-05 09:58:07 +00:00
Charles-Edouard Brétéché
5d6b987eec
refactor: kyverno_policy_execution_duration_seconds metric management (#6782)
* refactor: kyverno_policy_results metric management

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: kyverno_policy_results metric management

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 16:34:58 +00:00
Charles-Edouard Brétéché
b2340785fc
refactor: kyverno_policy_results metric management (#6781)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 23:07:43 +08:00
Charles-Edouard Brétéché
2f1ac317f4
feat: add flag to skip resource filters in reports controller (#6778)
* feat: add flag to skip resource filters in reports controller

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* codegen

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 13:05:29 +00:00
Charles-Edouard Brétéché
298e250693
feat: add exclude roles/cluster roles support in configmap (#6779)
* feat: add exclude roles/cluster roles support in configmap

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* update chart

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* filter handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 11:59:02 +00:00
Vyom Yadav
80fc3013d3
fix: Support subresources as the trigger in generate rules (#6760)
* fix: check background scanning only for validation policies

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

* fix: Support subresources as the trigger in generate rules

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>

---------

Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>
2023-04-04 11:01:06 +00:00
Charles-Edouard Brétéché
4634760e9e
refactor: resolve roles/cluster roles/top level GVK earlier in the admission chain (#6775)
* refactor: remove more admission request pointers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: resolve roles/cluster roles earlier in the admission chain

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* enrich

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* enrich

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 10:23:20 +00:00
Charles-Edouard Brétéché
c9bbf38191
refactor: remove more admission request pointers (#6774)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-04 13:11:18 +08:00
Charles-Edouard Brétéché
40ac8eb863
feat: add context/preconditions support to mutate existing (#6754)
* refactor: engine handlers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* feat: add context/preconditions support to mutate existing

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* readme

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix and context kuttl test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* validation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* final fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-04-03 19:58:58 +00:00
Charles-Edouard Brétéché
18033a415b
refactor: remove admission request/response pointers (#6769)
* refactor: remove admission request/response pointers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-03 18:08:57 +00:00
Charles-Edouard Brétéché
4cf5903545
fix: allow empty image (#6767)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-03 17:01:35 +00:00
Pradeep Lakshmi Narasimha
cc9adc5cd8
Adding validation to reject audit mode policy creation/updation when mutateDigest is set to true (#6757)
* Adding validation to reject audit mode policy creation/updation when mutateDigest is set to true

Signed-off-by: praddy26 <pradeep.vaishnav4@gmail.com>

* fix tests

Signed-off-by: realshuting <shutting06@gmail.com>

---------

Signed-off-by: praddy26 <pradeep.vaishnav4@gmail.com>
Signed-off-by: realshuting <shutting06@gmail.com>
Co-authored-by: realshuting <shutting06@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-04-03 15:52:32 +00:00
Charles-Edouard Brétéché
9ac141fcb9
fix: don't filter on group when service based apiservice discovery fails (#6766)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-03 14:44:01 +00:00
Ved Ratan
367156f60b
[Chore] Bump to Go 1.20 (#6683)
* changed go version 1.19->1.20

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* updated go version in actions

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* bumped golangci-lint

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix conflicts

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed some linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* possible fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* small fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fix

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Signed-off-by: Ved Ratan <82467006+VedRatan@users.noreply.github.com>
2023-04-03 11:40:47 +00:00
Charles-Edouard Brétéché
b4a4e3a4f3
refactor: don't process context/preconditions in invokeHandler (#6751)
* refactor: engine handlers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: don't process context/preconditions in invokeHandler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-04-03 12:57:48 +08:00
shuting
a243b405d2
add a kuttl test (#6622)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-31 12:27:25 +02:00
Charles-Edouard Brétéché
263fd8a7a8
refactor: introduce image mutation handler (#6735)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-31 06:41:48 +00:00
shuting
55d2eeaded
refactor - fire generate upon trigger deletion (#6736)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-31 06:08:14 +00:00
shuting
efe09b286e
fix source in events (#6739)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-31 07:34:31 +02:00
Charles-Edouard Brétéché
94f0829a37
fix: no skip result when no image match the rule (#6733)
* fix: no skip result when no image match the rule

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-30 15:31:11 +00:00
Charles-Edouard Brétéché
eaaa8a0236
refactor: engine responses (#6738)
* refactor: engine responses

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-30 11:59:32 +00:00
Charles-Edouard Brétéché
d0841e4918
refactor: introduce pss validation handler (#6724)
* refactor: remove rules pointer

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: introduce pss validation handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-30 09:51:16 +00:00
shuting
e2a8d9fa04
fix: event message for the image verify rule (#6734)
* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-30 09:14:02 +00:00
shuting
805f7b72a9
remove unused ctx (#6725)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-29 18:23:29 +00:00
Charles-Edouard Brétéché
43811733dc
refactor: remove rules pointer (#6722)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-29 17:44:09 +00:00
Vyom Yadav
c01b5cc381
fix: Don't check for subresource existence when it is the trigger. (#6544)
Signed-off-by: Vyom-Yadav <jackhammervyom@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-29 15:54:42 +00:00
Charles-Edouard Brétéché
c7192912fa
refactor: add preconditions check to engine invokeHandler (#6721)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-29 13:33:02 +00:00
Charles-Edouard Brétéché
7e8f72ccd3
fix: cap and validate webhook timeout (#6715)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-29 07:02:52 +00:00
Charles-Edouard Brétéché
dc8a60a43e
feat: add operations support in match/exclude (#6658)
* feat: add operations support in match/exclude

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* matching

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* operation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* make operation mandatory

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-29 04:22:21 +00:00
Charles-Edouard Brétéché
74664d4280
chore: remove dead code (#6710)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-28 14:43:25 +00:00
Charles-Edouard Brétéché
db29d8b2ba
fix: propagate error when parsing an image fails (#6706)
* fix: propagate error when parsing an image fails

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* Apply suggestions from code review

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-28 13:36:07 +00:00
Charles-Edouard Brétéché
391f1ae487
fix: allow image to be not present (#6707)
* fix: allow image to be not present

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* log

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-28 13:02:29 +00:00
Charles-Edouard Brétéché
341ed36e54
refactor: make use of handlers in engine validation (#6704)
* refactor: make use of handlers in engine validation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* polex

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-28 07:47:53 +02:00
Charles-Edouard Brétéché
dbc442b9e1
refactor: introduce image validation handler (#6697)
* refactor: factorise rule handler invocation code

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: introduce validation handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: introduce image validation handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-27 15:11:27 +00:00
Charles-Edouard Brétéché
84d4bb4998
refactor: introduce validation handler (#6695)
* refactor: factorise rule handler invocation code

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: introduce validation handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-27 13:53:42 +00:00
shuting
81ec6c96a1
fix auth validation (#6696)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-27 11:56:24 +00:00
Charles-Edouard Brétéché
03220cd8a9
refactor: factorise rule handler invocation code (#6694)
* refactor: factorise rule handler invocation code

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-27 11:22:54 +00:00
shuting
6a60a3da2b
fix: failed to update UR status (#6676)
* reconcile failed URs

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* - getting URs by client; - lose ur status update;

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* retry if the trigger is in termination

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* set retry limit to 3

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-27 08:44:12 +00:00
Charles-Edouard Brétéché
e3b4a84c66
refactor: implement mutation rule handlers (#6684)
* refactor: implement mutation rule handlers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-27 16:09:46 +08:00
Charles-Edouard Brétéché
873ea5c564
refactor: introduce engine handler (#6680)
* refactor: introduce engine handler

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-24 16:24:00 +00:00
Charles-Edouard Brétéché
1e30aacbd9
fix: replace more refect.DeepEqual (#6674)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-24 10:01:49 +00:00
Charles-Edouard Brétéché
5a9befd847
fix: HasVerifyImages check (#6668)
* fix: HasVerifyImages check

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-24 08:52:26 +00:00
Charles-Edouard Brétéché
7c571f76f4
feat: add support for ready message (#6670)
* feat: add support for ready message

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* Update .vscode/launch.json

Signed-off-by: shuting <shutting06@gmail.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: shuting <shutting06@gmail.com>
Co-authored-by: shuting <shutting06@gmail.com>
2023-03-24 07:33:55 +00:00
Charles-Edouard Brétéché
36964a3d95
refactor: engine matching/filtering (#6289)
* refactor: improve engine logger management

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* logger

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: engine matching/filtering

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* more

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix cli tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix cli test

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* match in the engine first

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* match in the engine first

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-24 00:03:40 +08:00
Charles-Edouard Brétéché
dd7ecff386
refactor: remove more pointers from engine api (#6651)
* refactor: remove more pointers from engine api

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* debug

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-23 20:58:52 +08:00
Charles-Edouard Brétéché
6f65b4416e
fix: filter name in add/sum error (#6657)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-23 08:11:56 -04:00
Ankit Kurmi
f8b352ff55
fix: adding verbosity to openapi unit tests (#6580)
Signed-off-by: Ankit152 <ankitkurmi152@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-23 12:01:49 +01:00
Ved Ratan
893c22b96b
[Feature] The ability to sum quantities (#6552)
* implemented array sum functionality

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* provided tests and fixed some bugs

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added sum functionality

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed sonatype liftbot issue

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* restructured the code implementation

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added helper errors

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* removed commented codes

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* modified error message

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* applied requested changes

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* removed some more comments

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* added more tests

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

* fixed linter issues

Signed-off-by: Ved Ratan <vedratan8@gmail.com>

---------

Signed-off-by: Ved Ratan <vedratan8@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-23 08:59:05 +00:00
Charles-Edouard Brétéché
7cd160a90a
refactor: discovery client (#6652)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-23 06:12:44 +00:00
Charles-Edouard Brétéché
49f0baa277
fix: policy validation with subresource and background scan enabled (#6571)
* fix: policy validation with subresource

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* workflow

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 17:12:10 +00:00
Charles-Edouard Brétéché
9e5f19b899
fix: do not create UR for dryrun admission requests (#6649)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 15:29:42 +00:00
Charles-Edouard Brétéché
6a0a336755
refactor: return structs instead of pointer in engine api (#6647)
* refactor: return structs instead of pointer in engine api

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 22:55:00 +08:00
shuting
6249ab70e8
fix: block generate policies when lack of permission to operate downstream resources (#6610)
* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* return on errors only

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update clusterrolebinding

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update clusterrolebinding

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add kuttl tests

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix ns

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-22 13:14:57 +00:00
Charles-Edouard Brétéché
f5e96e6ef2
fix: check if resource is empty when matching (#6644)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 12:41:16 +00:00
Charles-Edouard Brétéché
3aa3c022f4
fix: GVK fallback in policy context (#6648)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 20:07:12 +08:00
Charles-Edouard Brétéché
aa6400269e
refactor: implement matching based on GVK/subresource (#6633)
* refactor: do not allow matching with subresource kind

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* refactor: implement matching based on GVK/subresource

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 18:18:11 +08:00
Charles-Edouard Brétéché
aadaec09e1
fix: remove a couple DeepEqual and fix deletion check bug (#6640)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-22 04:46:35 +00:00
shuting
56a4222ceb
fix: skip duplicate PSa checks for the latest version (#6634)
* add version check

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* debug

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* skip multiple applies

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* skip multiple applies

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-21 14:03:40 +00:00
Charles-Edouard Brétéché
e06c20f5cc
refactor: do not allow matching with subresource kind (#6625)
* refactor: do not allow matching with subresource kind

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-21 13:28:00 +00:00
Charles-Edouard Brétéché
08def22d04
fix: incorrect old resource check (#6635)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-21 12:47:50 +00:00
Charles-Edouard Brétéché
bf8a478310
fix: use GVR in reports resource controller (#6612)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-20 13:08:31 +08:00
Charles-Edouard Brétéché
3c16c60912
refactor: admission reports aggregation (#6568)
* refactor: addmission reports aggregation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-17 12:07:17 +00:00
Charles-Edouard Brétéché
0b56613d59
fix: map APIResource in FindResources results (#6611)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-17 11:21:26 +00:00
Charles-Edouard Brétéché
fc453b1faa
fix: improve shutdown gracefulness (#5107)
* fix: improve shutdown gracefulness

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-17 18:48:48 +08:00
shuting
6f7f06f0d4
chore: cleanup generate codebase (#6598)
* add debug info

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* cleanup code

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* linter fix

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove unused labels

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* rename ns

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* reset resource version

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove ur updater

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix tests

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix tests

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* cleanup code

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove code to add labels to clone source #6583

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* rename ns

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remvove labels from test resource

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove generated by labels

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-17 08:36:06 +00:00
HIHIA
0849c8f929
fix: schema validation for mutateExisting type of policy (#6602)
Signed-off-by: HIHIA <283304489@qq.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-17 05:01:02 +00:00
Charles-Edouard Brétéché
a60e4c038c
feat: log when changes happen in policies (#6601)
* feat: log when changes happen in policies

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-16 17:17:21 +00:00
Charles-Edouard Brétéché
818b92bf60
test: add config unit test (#6595)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-16 16:34:30 +00:00
Charles-Edouard Brétéché
ad3bf969bf
fix: add message to bypass schema validation when it fails (#6604)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-16 15:03:00 +00:00
Abhishek Sawan
8be4460668
Added JMESPath filter to_boolean() (#6292)
* added to_boolean in JMESPath Filter

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* updated to_boolean JMESPath filter

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* updated to_boolean JMESPath filter with function registration

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* fixed to_boolean JMESPath filter with function registration

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>

* Update pkg/engine/jmespath/functions.go

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Abhishek Sawan <sawanabhi157@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-16 12:52:26 +00:00
Charles-Edouard Brétéché
7386dc9b9d
test: add config package unit tests (#6581)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-15 22:32:56 +08:00
Charles-Edouard Brétéché
a08d0b8749
feat: add webhook annotations support in config map (#6579)
* feat: add webhook annotations support in config map

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* release notes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* example

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-15 14:17:37 +01:00
shuting
dbfeb75793
feat: ignore admission requests sent by the kyverno background controller (#6499)
* ignore ARs sent by the kyverno background controller

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add background controller sa to exclude usernames

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-15 12:27:28 +00:00
Charles-Edouard Brétéché
4bd2e42b96
chore: remove unused discovery method GetServerVersion (#6577)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-03-15 11:36:44 +00:00
Charles-Edouard Brétéché
a7bebc20c1
fix: use GVRS to load mutation targets (#6576)
* fix: use GVRS to load mutation targets

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-15 10:47:25 +00:00
Charles-Edouard Brétéché
bedc6cbd27
fix: controller duration computation (#6569) 2023-03-15 15:11:00 +08:00
Ankit Kurmi
1271784918
fix: adding verbosity to the ./pkg/autogen unit tests (#6566)
Signed-off-by: Ankit152 <ankitkurmi152@gmail.com>
2023-03-14 11:40:34 +00:00
Charles-Edouard Brétéché
ed8b36631c
fix: remove hasVerifyYaml from policy cache (#6563)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-14 08:36:53 +00:00
Charles-Edouard Brétéché
861776d50c
fix: policy cache use GVR instead of kind (#6543)
* fix: policy cache use GVR instead of kind

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* GVRS

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* ephemeralcontainers

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* nit

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-13 14:44:39 +00:00
Charles-Edouard Brétéché
062bd798f0
test: add kuttl tests for policy kinds validation (#6547)
* test: add kuttl tests for policy kinds validation

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-13 18:24:11 +08:00
Charles-Edouard Brétéché
73d2063853
feat: change webhook configuration to better support wildcards (#6534)
* feat: change webhook configuration to better support wildcards

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-13 09:27:49 +00:00
shuting
637f830917
feat: apply generate rules on trigger events (#6508)
* - fire generation on trigger deletion, with condition rules;
- delete downstream if trigger no longer matches;
- delete downstream if trigger is deleted, with sync rule

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* trim condition key spaces

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix UR spec

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-create-on-trigger-deletion

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-create-on-trigger-deletion

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-data-sync-delete-trigger

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-data-nosync-delete-trigger

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-data-sync-update-trigger-no-match

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* rename policy

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-data-nosync-update-trigger-no-match

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add debug logs

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-clone-create-on-trigger-deletion

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update readme

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-clone-sync-delete-trigger

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-clone-nosync-delete-trigger

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-clone-sync-update-trigger-no-match

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update readme

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test cpol-clone-nosync-update-trigger-no-match

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-10 17:17:10 +00:00
Charles-Edouard Brétéché
0810290f26
fix: process audit policies when admission reports are disabled (#6531)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 15:44:28 +00:00
shuting
48726dcd4a
feat: validate immutable fields for a generate rule - 2 (#6451)
* update validation checks

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix ns assertions

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-03-10 14:39:44 +00:00
shuting
85a83e4fae
fix: namespace matching for background namespaced policies (#6530)
* fix namespace matching for background policies

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* add a kuttl test match-trigger-namespace

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 13:55:08 +00:00
Charles-Edouard Brétéché
5160b63154
feat: use kind selectors (#6514)
* fix: compile regex globally

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* feat: use kind selectors

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* clean

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* cache

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* webhooks rules

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* kuttl

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 13:24:55 +00:00
Charles-Edouard Brétéché
6abc7f2e03
fix: improve reports controller default values and workers (#6522)
* fix: improve reports controller default values and worker

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* nits

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 09:39:20 +00:00
Charles-Edouard Brétéché
0fb8c723fe
refactor: reduce userinfos deps and add unit tests (#6524)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 09:09:19 +00:00
Charles-Edouard Brétéché
c491c24039
fix: lookup GVR from GVK (#6517)
* fix: lookup GVR from GVK

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* typo

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-10 15:15:48 +08:00
Charles-Edouard Brétéché
1efcd40d04
fix: file name (#6523)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-09 22:17:26 +00:00
Charles-Edouard Brétéché
89cfa88c1e
fix: lookup GVK from GVR (#6516)
* fix: lookup GVK from GVR

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* error

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2023-03-09 22:52:44 +08:00