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

322 commits

Author SHA1 Message Date
Charles-Edouard Brétéché
be4705faa3
fix: use deleteOptions in cleanup controller (#11662)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-11-25 16:18:58 +05:30
Shivam Kumar
30d475aaae
Passed the deleteOptions to the DeleteResource client (#11484)
* Passed the deleteOptions to the DeleteResource client

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* fix:minor change in the DeleteResource client

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

---------

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-11-19 09:26:17 +00:00
shuting
244dbe19cf
fix: update explicit webhook based on the policy type (#11580)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
2024-11-13 21:09:36 +05:30
Fleezesd
6b87d70b39
chore: change controller rated limiting queue (#11509)
Signed-off-by: Fleezesd <1253576349@qq.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-11-04 13:48:58 +00:00
Mariam Fahmy
5106d5227b
fix: use webhook object instead of a list (#11516)
* fix: use webhook object instead of a list

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* chore: add changelog

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-11-04 10:19:35 +00:00
Shivam Kumar
1bc76f6d7f
Introduced the DeletionPropagationPolicy field in CleanupPolicy and C… (#11368)
* Introduced the DeletionPropagationPolicy field in CleanupPolicy and ClusterCleanupPolicy

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Add DeletionPropagation field to API versions and implement handling in controller.go for improved cleanup functionality

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* removed the type for DeletionPrpagationPolicy

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Add DeletionPropagationPolicy to CleanupPolicy

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Updated DeletionPropagationPolicy in different api versions

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Removed the string type declaration from the DeletionPropagationPolicy

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Reverted the changes

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Added the DeletionPropagation to the cleanup/controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixed minor bugs

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixed the verify-codegen error

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Revert "Fixed the verify-codegen error"

This reverts commit 05428bd99b187b93086dc403e674f06f8eeb5a40.

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Changed the field's type string to pointer

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixing the linter issue

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* changing the v1 to metav1 in the controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved linter problem

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* fix: codegen

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* Refactor DeletionPropagationPolicy to use a pointer type

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixed linter

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Refactor String type to pointer in controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* fixing Linter

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Make DeletionPropagationPolicy optional in validation

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* fix: Update validation for DeletionPropagationPolicy in CleanupPolicySpec

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Refactored deletion policy handling

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved linter

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Updated logic to set deletion options based on user-provided deletion policy.

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Removed default deletion policy assignment in the deletion logic

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: removed default deletion policy in the deletion logic

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixing minor issues

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Linter

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* fix: propagation policy

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: ShivamJha2436 <shivamkumar87148@gmail.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-22 13:04:01 +02:00
Mariam Fahmy
cbfeb32b1a
fix[breaking]: disable exceptions by default (#11426)
* fix[breaking]: disable exceptions by default

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: add warning in helm chart for exceptions

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-10-22 06:07:11 +00:00
Charles-Edouard Brétéché
3580034fa1
feat: improve webhooks rules generation (#11419)
* feat: improve webhooks rules generation

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

* iterate per rule

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

* reduce rules

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

* rework default operations

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

* consider subresource

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

* aggregate operations

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

* sort rules

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>

* operations

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

* aggregation

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

* operations type

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

* generate rules

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>

* generate

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

* all operations

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

* collector changes

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

* account for exclusions

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>

* fix exclusions when no operations specified

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>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-10-21 12:56:21 +00:00
Vishal Choudhary
e3b74f1384
feat: add options to configure resync period for informers in helm chart (#11420)
* feat: add options to configure resync period for informers in helm chart

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: codegen

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-10-17 15:23:17 +08:00
Charles-Edouard Brétéché
a5e082303d
refactor: introduce autogen interface (#11418)
* refactor: introduce autogen interface

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>
2024-10-16 15:24:37 +02:00
Charles-Edouard Brétéché
4d1683d167
refactor: move autogen v1 and v2 packages (#11416)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-16 08:51:38 +00:00
Charles-Edouard Brétéché
884a6389c6
fix: use autogen v2 in exceptions controller (#11397)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-16 07:41:20 +00:00
Utsab Sapkota
c44b532d73
Added GetNames and GetKinds function (#11327)
* Added GetNames and GetKinds function

Signed-off-by: utsab818 <utsabsapkota4231@gmail.com>

* fix: updated func GetAutogenRuleNames

Signed-off-by: utsab818 <utsabsapkota4231@gmail.com>

* fix: exception controller

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

* fix: autogen status

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

---------

Signed-off-by: utsab818 <utsabsapkota4231@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>
2024-10-14 14:49:20 +02:00
Vishal Choudhary
ec546e6fb4
feat: add helm configuration for reporting in different rules (#11376)
* feat: add helm configuration for reporting in different rules (forgot signoff)

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: linter and tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: rename reporting.imageVerification

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-10-11 09:42:29 +00:00
Ammar Yasser
c56c60c136
Reports controller circuit breaker (#11329)
* chore: Fix spelling issue in breaker logging

Signed-off-by: aerosouund <aerosound161@gmail.com>

* feat: Introduce circuit breaking in background report scanning

Add the breaker as a field of the background controller and use it in the storeReport method which handles report creation

Signed-off-by: aerosouund <aerosound161@gmail.com>

* feat: Add required flags and instantiation for the circuit breaker in the background reports controller

Signed-off-by: aerosouund <aerosound161@gmail.com>

* fix: Add flag for max background reports in the reports controller

Signed-off-by: ammar <ammar.yasser@vodafone.com>

* chore: Update flag description to use ephemeralreports instead of background reports

Signed-off-by: aerosouund <aerosound161@gmail.com>

* chore: Use a less verbose description for the flag

Co-authored-by: shuting <shuting@nirmata.com>
Signed-off-by: Ammar Yasser <aerosound161@gmail.com>

---------

Signed-off-by: aerosouund <aerosound161@gmail.com>
Signed-off-by: ammar <ammar.yasser@vodafone.com>
Signed-off-by: Ammar Yasser <aerosound161@gmail.com>
Co-authored-by: ammar <ammar.yasser@vodafone.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-10-11 07:34:41 +00:00
Charles-Edouard Brétéché
bd3a6f066b
chore: use ptr package (#11346)
* chore: use ptr package

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>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-07 14:10:20 +00:00
Shivam Kumar
9f5e75a2b5
Test/ttl cleanup deletion policy (#11277)
* Added propagationPolicy to TTL controller for resource deletion

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Added per-resource deletion policy with optional global default

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Added nil check for annotations to prevent runtime errors

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Moved logic for retrieving propagation policy from annotations to a dedicated function

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Resolve merge conflict in controller.go and update propagation policy handling
- Added missing gvr field from main branch
- Improved annotation naming as per team discussion
- Moved propagation policy logic closer to usage

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Simplified propagation policy logic

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Add unit tests for controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Removed the test file for controller.go and fixed the lint error

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* test: add unit tests for deletion propagation policy in TTL-based cleanup

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved conflicts

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved conflicts

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved merge conflict

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix:Updated the unit tests

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Removed the method receiver from determinePropagationPolicy as it does not require access to the controller struct

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Fixed the formatting issue

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: removed the switch statement inside the test case

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Updated the controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Resolved the formatting issue

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixing the deleted resource label in controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fixed the linter issue

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

---------

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-07 13:44:55 +00:00
Vishal Choudhary
fe49e97fba
feat: add reporting to mutate and generate rules (#11265)
* feat: add reports to standard mutatation

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add warnings for permissions

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: remove unnecessary fields

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add reporting to generate and mutate existing

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add reporting to generate and mutate existing

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: codegen and add generate tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: linter

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: e2e matrix

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: cleanup

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-02 12:05:05 +00:00
Shivam Kumar
48b7a68733
Added propagationPolicy to TTL controller for resource deletion (#11207)
* Added propagationPolicy to TTL controller for resource deletion

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Added per-resource deletion policy with optional global default

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Added nil check for annotations to prevent runtime errors

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Moved logic for retrieving propagation policy from annotations to a dedicated function

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Fix: Resolve merge conflict in controller.go and update propagation policy handling
- Added missing gvr field from main branch
- Improved annotation naming as per team discussion
- Moved propagation policy logic closer to usage

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Simplified propagation policy logic

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Add unit tests for controller.go

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

* Removed the test file for controller.go and fixed the lint error

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>

---------

Signed-off-by: ShivamJha2436 <shivamkumar87148@gmail.com>
2024-09-27 14:45:09 +00:00
Charles-Edouard Brétéché
3de1cb3f4f
fix: webhooks reconciliation with policies (#11233)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-09-25 12:12:08 +00:00
Charles-Edouard Brétéché
bfb00cffc8
fix: webhooks reconciliation when no policies (#11230)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-09-25 11:08:03 +00:00
Khaled Emara
e3b51e16a9
fix(webhook): error variable (#11225)
Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
2024-09-25 09:41:17 +00:00
Khaled Emara
9541608182
fix(status): status comparison is wrong (#11203)
* fix(status): status comparison is wrong

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* fix(status): retry status update after first failure

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-09-24 15:17:38 +00:00
Pradeep Lakshmi Narasimha
1ab1897d2c
fix: Added missing label info in the cleanup metrics (#10321) (#11147)
Signed-off-by: Pradeep Lakshmi Narasimha <pradeep.vaishnav4@gmail.com>
2024-09-16 08:57:59 +00:00
Vishal Choudhary
71f29d011c
fix: make webhook cleanup setup optional and add cleanup ci test (#11077)
* fix: make webhook cleanup setup optional and add cleanup ci test

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: add logging

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: add validating webhook count check

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-09-11 08:38:45 +02:00
Charles-Edouard Brétéché
e7e2f0a07f
feat: use pointer in rule (mutation field) (#11078)
* feat: use pointer in rule (mutation field)

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>
2024-09-11 04:32:10 +03:00
Charles-Edouard Brétéché
b5e1c97913
feat: use pointer in rule (exclude field) (#11050)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-09-10 11:14:49 +00:00
Charles-Edouard Brétéché
d5dcd4611d
feat: use pointer in rule (#11037)
* feat: use pointer in rule

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>

* fix policy controller

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

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-09-09 21:10:02 +08:00
Khaled Emara
0a4c14eb82
fix(status): don't get the policy twice before status update (#11026)
* fix(status): don't compare uid

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(webhook): logger message

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
2024-09-09 18:30:26 +08:00
Anushka Mittal
37ab9ba824
fix: range through all resources to build webhook (#10748)
* fix: range through all resources to build webhook

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* chore: add tests

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* chore: correct conformance

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* chore: correct conformance pod all subresources

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* fix: append resource when operations and scope is same

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* fix: correct tests

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* fix: chainsaw tests

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* fix: flaky test

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* chore: remove debug lines

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

---------

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
Co-authored-by: anushkamittal20 <anumittal4641@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-09-05 11:42:40 +00:00
Vishal Choudhary
c0d6eaddb3
feat: delete webhook configurations after kyverno is uninstalled (#10782)
* feat: delete webhook configurations after kyverno is uninstalled

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: optionally add permissions

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: linter

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: disable finalizers in latest manifest

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: move webhook cleanup to webhooks controller

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add finalizers on deployment

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: refactor

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add roles to cleanupcontroller

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add cleanup to generic controllers

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add webhook cleanup in generic controllers

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: remove unnecessary clusterrole and clusterrole bindings

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: make this behaviour opt-in

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: reconcile webhook setup on deployment change

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: update codegen and remove unused vars

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* feat: add finalizers to chart

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-09-04 10:59:59 +00:00
Mariam Fahmy
bde90340a6
chore: remove v1alpha1 of VAPs and use v1beta1 (#10955)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-08-29 15:31:25 +00:00
shuting
2cd462570a
feat: foreach support for clone (#10888)
* chore: add chainsaw tests for foreach clone

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

* fix: update webhooks for foreach generate

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

* chore: rename generatePattern

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

* chore: chainsaw tests for generateExisting

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

* chore: add missing files

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

* chore: add chainsaw tests for foreach clone, sync=true

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

* fix: linter issues

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

* chore: add chainsaw test foreach clonelist, sync=true, delete source

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

* fix: sync deletion for cloneList

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-08-29 11:59:22 +00:00
Charles-Edouard Brétéché
f87fa52cb7
feat: bump to k8s 1.31 (#10938)
* feat: bump to k8s 1.31

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

* tidy

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

* mod

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

* fix otel

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

* fix otel schema

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

* update linter

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

* feat: fix image verification tests

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* linter issues

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

* cel change

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: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-08-28 17:09:58 +00:00
Jim Bugwadia
3c63152f18
update message (#10862)
Signed-off-by: Jim Bugwadia <jim@nirmata.com>
2024-08-15 14:42:29 +00:00
Mariam Fahmy
25b7142ee0
feat: generate VAPs from exceptions (#10771)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-08-13 11:55:22 +00:00
Mariam Fahmy
c796bb765c
fix: return policies with either audit or enforce rules from the cache (#10667)
* fix: return policies with either audit or enforce rules from the cache

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* feat: introduce validationFailureAction under verifyImage rules

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* feat: add chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-08-06 18:24:28 +00:00
Frank Jogeleit
deab83d62f
reconcile only PolicyReports managed by kyverno (#10794)
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
Co-authored-by: shuting <shuting@nirmata.com>
2024-08-06 12:43:47 +00:00
Mariam Fahmy
716611b7ea
fix: return all the exceptions that match the incoming resource (#10722)
* fix: return all the exceptions that match the incoming resource

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: modify log messages

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-07-25 17:36:19 +00:00
Anushka Mittal
429b05544a
fix: compute operations for mutatingwebhookconf (#10639)
* fix: compute operations for mutatingwebhookconf

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

* chore: add unit test

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>

---------

Signed-off-by: anushkamittal20 <anumittal4641@gmail.com>
Co-authored-by: anushkamittal20 <anumittal4641@gmail.com>
2024-07-10 10:02:04 +00:00
Mariam Fahmy
a46f1eb48c
fix: failed to delete resource (#10582)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-07-02 19:54:27 +00:00
Mariam Fahmy
f738b027c3
fix: cleanup policy name is appended to logs (#10583)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-07-02 16:32:51 +00:00
Charles-Edouard Brétéché
e900abf3a0
feat: remove kyverno client v2beta1 (#10543)
* feat: remove kyverno client v2beta1

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 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>
2024-06-26 08:48:32 +00:00
Mariam Fahmy
ff88c4c39a
feat: migrate validationFailureAction and validationFailureActionOverrides (#10528)
* feat: migrate validationFailureAction and validationFailureActionOverrides under validate rule

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* feat: add unit tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-06-26 09:13:02 +02:00
Mariam Fahmy
94d9bbe73f
chore: use v2 clients for policy exceptions (#10530)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-06-24 16:36:55 +00:00
Mariam Fahmy
e892a0531e
chore: add tests that use spec.webhookConfiguration (#10526)
* chore: add tests that use spec.webhookConfiguration

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix chainsaw tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-06-24 13:40:50 +00:00
Mariam Fahmy
abe2a2310b
feat: migrate webhookTimeoutSeconds and failurePolicy (#10515)
* feat: migrate webhookTimeoutSeconds and failurePolicy

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix lint issue

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-06-20 13:04:37 +00:00
Charles-Edouard Brétéché
b36a2ecdcc
feat: bump update request api version (#10508)
* feat: bump update request api version

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

* use v2

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>

* codegen

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>

* 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>
2024-06-20 09:44:43 +00:00
Charles-Edouard Brétéché
6e1def1004
feat: remove v1alpha2 group/version (#10500)
* feat: remove v1alpha2 group

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 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>
2024-06-19 08:08:15 +00:00
Charles-Edouard Brétéché
7f57b9618a
feat: cleanup v2alpha1 kyverno api (#10457)
* feat: cleanup v2alpha1 kyverno api

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 tests

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

* fix: webhook

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>
2024-06-14 09:39:36 +00:00