1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
Commit graph

2797 commits

Author SHA1 Message Date
yinka
a1e9856846
fix: make zapr compatible with klog's -v argument (#5166)
* make zapr compatible with klog's -v argument

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* remove zap logger's NameKey

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
2022-11-09 15:10:27 +00:00
Charles-Edouard Brétéché
ff5e0a361c
feat: add flag to control leader election frequency (#5172)
* feat: add flag to control leader election frequency

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

* changelog

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-11-09 11:37:00 +00:00
Charles-Edouard Brétéché
cc8f643767
refactor: admission metrics (counter and latency) (#5245)
* refactor: move all middlewares in handlers sub package

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

* refactor: admission metrics (counter and latency)

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

* builder

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>

* cleanup

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-09 18:52:20 +08:00
Sandesh More
83235ed10d
fix: resource schema validation in policies under any/all match (#5246)
Signed-off-by: Sandesh More <sandesh.more@infracloud.io>

Signed-off-by: Sandesh More <sandesh.more@infracloud.io>
2022-11-09 07:37:11 +00:00
Charles-Edouard Brétéché
80c78a5439
fix: keep admission warnings (#5269)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-11-08 16:52:57 +00:00
Charles-Edouard Brétéché
b71c0004d0
fix: account for error rules in mutation webhook (#5264)
* fix: account for error rules in mutation webhook

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

* add 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>
2022-11-08 12:36:13 +01:00
Charles-Edouard Brétéché
060f7bb873
refactor: admission response utils (#5234)
- refactor: admission response utils
- unit tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-08 09:35:08 +00:00
Nikhil Sharma
6d801b26db
feat: create cleanup new CRDs (#5233)
* create new cleanup CRDs

Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>

* fix package

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

Signed-off-by: Nikhil Sharma <nikhilsharma230303@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-08 08:42:35 +00:00
Charles-Edouard Brétéché
564c92d4bf
fix: add warning when using deprecated validation failure action (#5219)
* fix: add warning when using deprecated validation failure action

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>
Co-authored-by: shuting <shuting@nirmata.com>
2022-11-07 22:16:53 +00:00
Charles-Edouard Brétéché
35123af638
fix: remove unused code in config (#5242)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-07 16:48:25 +00:00
Charles-Edouard Brétéché
e4c493093e
feat: separate webhook rules per GVK/rule (#4986)
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>
2022-11-07 16:05:56 +00:00
Charles-Edouard Brétéché
a08c8b03fe
refactor: move all middlewares in handlers sub package (#5244)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-07 14:53:40 +00:00
Vyankatesh Kudtarkar
c639c6d681
fix generateName mutation (#5146) 2022-11-07 19:50:50 +05:30
Vyankatesh Kudtarkar
a6e866fe1f
Fix Keda policy installation issue (#5239) 2022-11-07 18:54:44 +05:30
Vyankatesh Kudtarkar
42322bae09
[BUG] Fix foreach deletion issue (#5224)
* fix foreach deletion issue
2022-11-04 09:35:25 +00:00
Charles-Edouard Brétéché
786e595c06
feat: add policy label to policy reports (#5198)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-04 07:55:41 +00:00
shuting
da84b777bc
fix: too much information for the Policy Rule Execution Latency metric (#5208)
* remove general_rule_latency_type

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

* remove resource_request_operation

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

* remove resource_namespace

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

* remove resource_kind

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

* fix linter

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

Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
2022-11-04 14:31:23 +08:00
Charles-Edouard Brétéché
a64475a6db
refactor: health check system (#5176)
* refactor: health check system

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>

* 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: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-11-03 11:19:38 +01:00
Charles-Edouard Brétéché
f52da91b72
fix: early return in policy validation (#5200)
* fix: early return in policy validation

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>
2022-11-03 09:05:23 +00:00
shuting
3fc157717a
feat: support disabling schema validation on the patched resource (#5197)
* Support disable schema validation on the patched resource

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

* update api doc

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

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-11-03 08:12:44 +00:00
Charles-Edouard Brétéché
076f2c3c49
fix: deletion of reports not belonging to kyverno (#5194)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-02 10:08:54 +00:00
Charles-Edouard Brétéché
9f6b0e8017
refactor: remove policyreport package (#5174)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-02 09:06:44 +00:00
Charles-Edouard Brétéché
547771a221
fix: use pagination to aggregate reports (#5190)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-02 15:10:48 +08:00
Charles-Edouard Brétéché
05d90afe1b
fix: check resource version on update notification (#5179)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-01 21:49:25 +01:00
Charles-Edouard Brétéché
0696e54378
fix: content type in log (#5177)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-11-01 13:51:20 +00:00
Charles-Edouard Brétéché
d2658a1bc8
refactor: support Audit and Enforce validation failure actions (#5152)
* feat: remove policy mutation 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>

* refactor: support Audit and Enforce failure actions

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>

* fix

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>

* update changelog

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-11-01 09:56:52 +00:00
yinka
8a59e240c6
fix: configure klog and global logger to use zapr in json mode (#5144)
* configure klog and global logger to use zapr in json mode

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* changes

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* make zapr compatible with klog's -v argument

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* remove changes

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* remove logLevel flag

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2022-10-28 20:52:58 +00:00
Pratik Shah
2c4a2dab7e
Fixed issue-5102: Show rule count and type in output (#5106)
Signed-off-by: Pratik Shah <pratik@infracloud.io>

Signed-off-by: Pratik Shah <pratik@infracloud.io>
2022-10-27 10:05:32 +00:00
shuting
cf2b8dafa6
skip generating events on empty rule response (#5158)
Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-10-27 08:34:55 +00:00
shuting
fe7ea67f47
reset resource version on update (#5157)
Signed-off-by: ShutingZhao <shuting@nirmata.com>

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2022-10-27 13:35:42 +05:30
Pradeep Lakshmi Narasimha
c3740d1c5b
fix: mutation policy inconsistent patching for ephemeralContainers (#5121)
* fix: mutation policy consistent patching for ephemeralContainers

Signed-off-by: praddy26 <pradeep.vaishnav4@gmail.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-26 05:20:32 +00:00
Charles-Edouard Brétéché
e4bf66e756
feat: remove policy mutation for auto-gen rules (#5123)
* feat: remove policy mutation 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>

* changelog

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>
2022-10-25 23:43:46 +00:00
Danny Kulchinsky
a3e2a20a23
fix finalizers mutation with patchesJson6902 (#5132)
* fix finalizers mutation with patchesJson6902

Signed-off-by: Danny Kulchinsky <dkulchinsky@fastly.com>
2022-10-25 12:04:07 +05:30
XDRAGON2002
a3c129f469
[Feature] create command line option to set failurePolicy globally (#4991)
* add forceFailurePolicyIgnore flag

Signed-off-by: Anant Vijay <anantvijay3@gmail.com>

* cleanup code

Signed-off-by: Anant Vijay <anantvijay3@gmail.com>

* add logging

Signed-off-by: Anant Vijay <anantvijay3@gmail.com>

* resolve merge conflicts

Signed-off-by: Anant Vijay <anantvijay3@gmail.com>

* fix codegen

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

Signed-off-by: Anant Vijay <anantvijay3@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@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>
2022-10-21 18:13:36 +00:00
yinka
822dbdc011
feat: enable/disable Debug mode which shows entire AdmissionReview payload (#5024)
* work in progress PR

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* add custom request struct

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* pass debug mode option through constructor and replace logger with klogr

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* make changes

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* cleanup

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

* fix linter

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

* add another test case

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* removed unused function

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>

* fix linter

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

Signed-off-by: damilola olayinka <holayinkajr@gmail.com>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@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>
2022-10-21 16:17:49 +00:00
Charles-Edouard Brétéché
5d0adadfa7
fix: use correct side effects in validating webhooks (#5080)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-21 16:53:55 +08:00
Charles-Edouard Brétéché
5a496ca212
refactor: simplify variables regex (#5075)
* feat: add simple conformance tests

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

* gh action

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

* separate workflow

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

* fix the bug

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>

* improvements

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

* improvements

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>

* fix: variables regex

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 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>
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-21 11:51:14 +08:00
Prateek Pandey
2078f0dfd2
fix: allow delete of target resource with synchronize false (#5081)
Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-10-20 19:41:57 +00:00
Prateek Pandey
7735ac3f83
fix: handle resource cleanup when policy is deleted (#5021)
* fix: handle delete UR when policy is deleted

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>

* fix cleanup

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>

* use selector to list the update request

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>

Signed-off-by: prateekpandey14 <prateek.pandey@nirmata.com>
2022-10-20 17:48:27 +00:00
Charles-Edouard Brétéché
0feec9bef5
fix: use correct logger in webhook controller (#5083)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-20 20:54:42 +05:30
Charles-Edouard Brétéché
ad2cbd3b33
feat: add simple conformance tests (#5073)
* feat: add simple conformance tests
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-20 12:17:33 +00:00
Charles-Edouard Brétéché
e5b9af44e7
fix: make reponse order predictable (#5079)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

make response order predictable
2022-10-20 17:06:46 +05:30
Sandesh More
fa178ebd82
added apiCalls support in kyverno-apply command (#4938)
Signed-off-by: Sandesh More <sandesh.more@infracloud.io>

Signed-off-by: Sandesh More <sandesh.more@infracloud.io>
2022-10-19 16:39:15 +00:00
Charles-Edouard Brétéché
73712f3738
feat: add webhook server logger (#5063)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-19 13:12:55 +00:00
Charles-Edouard Brétéché
a0bcf7a966
fix: configure idle timeout in server (#5062)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-19 12:09:04 +00:00
Charles-Edouard Brétéché
6070092b6a
fix: image verification reports missing in admission mode (#5037)
* fix: image verification reports missing in admission mode

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

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-19 11:25:47 +00:00
Charles-Edouard Brétéché
eac23af077
fix: detection of kyverno going down (#5055)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
2022-10-19 10:06:48 +00:00
Charles-Edouard Brétéché
749c1bab3b
fix: do not update reports when they are identical (#5056)
* fix: do not update reports when they are identical

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

* fix linter

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-19 09:32:43 +00:00
Charles-Edouard Brétéché
c4b3301ab0
fix: go routines not gracefully shut down in controllers (#5022)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com>
2022-10-19 08:54:48 +00:00
Charles-Edouard Brétéché
cdfac95cdb
fix: account for policy/rule deletion in aggregated reports (#5048)
* fix: account for policy/rule deletion in aggregated reports

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

* reduce delay

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

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2022-10-19 08:16:28 +00:00