1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
Commit graph

928 commits

Author SHA1 Message Date
shuting
26a6b37265
feat: add evaluation mode to api (#12262)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2025-02-27 16:31:10 +05:30
Charles-Edouard Brétéché
ebaad6fbb1
feat: improve validating policy api (#12243)
* feat: improve validating policy 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>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-26 15:18:12 +00:00
sandert-k8s
c45e5946e1
Add aggegration toggle for clusterRoles (#12234)
* make aggregateClusterRoles optional

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* resync fork from main and runned `make codegen-helm-all` again

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* Rename value aggregateClusterRoles to userFacingRoles and seperated the admin and view role

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* edit the changes

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* Only toggle the label for aggegration, the rest of the labels should always be added to the roles

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* typo

Signed-off-by: sandert-k8s <sandert98@gmail.com>

* Fix variable path

Signed-off-by: sandert-k8s <sandert98@gmail.com>

---------

Signed-off-by: sandert-k8s <sandert98@gmail.com>
Co-authored-by: Sander Tervoert <sander.tervoert@odc-noord.nl>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-02-25 18:09:02 +00:00
Mariam Fahmy
75a10ac550
feat: introduce generic exception interface (#12244)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-02-25 16:11:19 +00:00
Charles-Edouard Brétéché
9d56f5f2b5
feat: stop reusing admissionregistrationv1.ValidatingAdmissionPolicySpec (#12246)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-02-25 14:48:47 +00:00
Mariam Fahmy
6359fd4a1a
feat: generate VAPs from VPs (#12222)
* feat: generate VAPs from VPs

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

* fix codegen

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>
2025-02-25 20:27:29 +08:00
Kevin Tijssen
136353b93f
Update _pdb.tpl (#11970)
policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+

Signed-off-by: Kevin Tijssen <kevin.tijssen@gmail.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-02-19 15:37:27 +00:00
Khaled Emara
2b28538bd3
feat(gctx): add jmespath caching through projections (#11833)
feat(gctx): move ready check to runtime

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-18 15:51:14 +00:00
Francesco Ilario
b0816b97ef
use serviceAccountName instead of deprecated serviceAccount (#12158)
Signed-off-by: Francesco Ilario <filario@redhat.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-17 22:46:29 +00:00
shuting
9aebe10d15
refactor: status manager (#12173)
* chore: move webhook status reconciler

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

* fix: status removal

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2025-02-14 15:22:25 +00:00
AlexLugovtsov
541bdcd16e
add get to rbac.authorization.k8s.io (#12043)
* add get to rbac.authorization.k8s.io

Signed-off-by: AlexLugovtsov <Aliaksei.luhautsou@telekom.com>

* codegen-manifest-all

Signed-off-by: AlexLugovtsov <Aliaksei.luhautsou@telekom.com>

---------

Signed-off-by: AlexLugovtsov <Aliaksei.luhautsou@telekom.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-02-14 13:59:37 +00:00
Frank Jogeleit
05f9bb4506
feat: configure admission and background flag for ValidatingPolicies (#12153) 2025-02-13 17:24:45 +00:00
Rafael da Fonseca
2da603ee1f
Add helm changelog for reports-server related fix (#12144)
* Add helm changelog for reports-server related fix

Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com>

* Remove old changelog entries

Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com>

---------

Signed-off-by: Rafael da Fonseca <rafael.fonseca@wildlifestudios.com>
2025-02-12 09:04:39 +00:00
Mariam Fahmy
7d5750a717
chore: move celexceptions to the new group (#12143)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-02-11 19:05:22 +02:00
Rafael da Fonseca
f6b85ee3e5
Don't fail disabling reports CRDs when sanitychecks is disabled (for use with reports-server) (#12129) 2025-02-11 12:56:29 +00:00
shuting
0548d09c21
feat: add status.autogen (#12109)
* feat: add status.autogen

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

* chore: update codegen

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

* chore: update codegen

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2025-02-07 22:22:49 +05:30
Mariam Fahmy
a4c10f6bb4
feat: compile and evaluate polex's match conditions (#12113)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-02-06 15:30:59 +02:00
Mariam Fahmy
04efe351a7
chore: remove polex match constraints (#12103)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-02-05 17:56:58 +00:00
shuting
1f3d82893b
feat: add vpol status (#11956)
* feat: add vpol status

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

* feat: update status API

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

* chore: update code-gen manifests

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

* feat: reconcile vpol.status.conditions

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

* chore: add missing files

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

* fix: add default webhook filters

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

* chore: update codegen

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

* chore: update codegen

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

* fix: enable .status subresource

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

* chore: add missing files

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

* fix: linter

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2025-02-05 14:16:53 +00:00
Charles-Edouard Brétéché
8fc6e78c16
feat: add validating policies to reports aggregation (#12096)
* feat: add validating policies to reports aggregation

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

* chainsaw test

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>
2025-02-05 13:21:28 +00:00
Mariam Fahmy
9e8b655f6f
chore: add celpolicyexceptions in helm chart (#12084)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-02-05 00:15:45 +08:00
Charles-Edouard Brétéché
b908b1037a
feat: consider validation actions (#12072)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-02-04 06:29:40 +02:00
Mariam Fahmy
4c950dcb32
feat: use v1 of ValidatingAdmissionPolicies (#12050)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-01-31 14:21:43 +00:00
Amit Tiwari
3b798c8958
replace ghcr.io to reg.kyverno.io (#12031)
Signed-off-by: Amit Tiwari <amit.tiwari@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-01-30 09:10:59 +00:00
Mariam Fahmy
da717c4b17
feat: add validation action to VPs (#12017)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2025-01-28 14:34:26 +01:00
shuting
97ed53f6bb
feat: register webhook configurations for validatingpolicies (#11892)
* feat: add spec.webhookConfiguration

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

* chore: refactor build webhook for kyverno policies

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

* chore: update yamls

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

* chore: add listers

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

* feat: update api

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

* chore: remove matchPolicy

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

* chore: update crd yaml

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

* chore: add short name

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

* chore: update deepcopy

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

* chore: upadte spec

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

* chore: fix description

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

* chore: add missing files

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

* feat: register webhook for validatingpolicies

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

* chore: fix import

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

* chore: add unit tests

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

* chore: update docs

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

* chore: update manifests

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

* chore: update unit tests

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

* chore: update manifests

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2025-01-17 11:33:47 +02:00
raffis
306a2e47d9
fix(reports-controller): add a flag to disable reports sanity checks (#11867)
* fix(reports-controller): remove crd sanity check

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>

* feat: add a flag to disable reports sanity checks

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

* feat: add changelog

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

---------

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2025-01-09 17:03:23 +08:00
Charles-Edouard Brétéché
3369a03844
feat: add validating policy crd in helm chart (#11870)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2025-01-09 13:04:54 +08:00
abhashsolanki18
0ca2eab0d0
fix: [Helm] mergeOverwrite overwrites nested objects #11536 (#11584)
Signed-off-by: abhashsolanki18 <abhashsolanki18@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-12-20 04:51:11 +00:00
shuting
bbbc436697
fix: remove extra line in configmsp (#11762)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-12-17 07:29:16 +00:00
Vishal Choudhary
69b2124358
fix(readme): add changelog for spec.validate[*].allowExistingViolations field in kyverno chart (#11714)
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-12-05 08:58:47 +00:00
Yann ILAS
d215ce5344
Fix(doc): correct invalid links in documentation (#11681)
* Fix doc: s|kustomize/patchesjson6902|kustomize/kustomization/patchesjson6902|

Signed-off-by: Yann ILAS <yann.ilas@gmail.com>

* Fix doc: s|kustomize/patchesstrategicmerge|kustomize/kustomization/patchesstrategicmerge|

Signed-off-by: Yann ILAS <yann.ilas@gmail.com>

---------

Signed-off-by: Yann ILAS <yann.ilas@gmail.com>
2024-12-02 13:31:33 +00:00
Matthias Weilinger
bb3e7d9ddc
add allowExistingViolations option in policy chart (#11656)
Until now it was not possible to set the allowExistingViolations for predefined policies in the policies chart. By default it should be set to , identical to how it is set up in the CRDs. Not only does this now allow users to set the config according to their needs, but this also solves a problem with ArgoCD. As the CRDs set it to true, but the template does not specifically declare the field, ArgoCD falls into a constant sync loop of trying to remove the field.

Signed-off-by: ProbstenHias <matthias.weilinger@gmx.de>
Co-authored-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-12-02 09:20:26 +05:30
Patrik Votoček
17b6ab0d10
fix(chart): global image registry bug in 3.3.3 (#11604)
Signed-off-by: Patrik Votoček <patrik@votocek.cz>
2024-11-26 21:17:50 +08:00
shuting
70b666e53c
fix: add conversion function in Helm template (#11651)
* fix: add conversion function in Helm template

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

* fix: retain object as is

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

* fix: json format

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

* fix: code-gen

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-11-25 15:10:23 +00:00
Caio Begotti
9070334df0
fix(policy chart): fix the merging of policyExclude customizations to avoid wrong overrides (#11653)
Signed-off-by: Caio Begotti <caiobegotti@gmail.com>
2024-11-25 11:48:18 +00:00
Sergey Kiyan
338d2ad473
fix: kubernetes and kyverno version annotations in kyverno-policies helm chart to match installed kyverno release and supported versions from Chart.yaml with override option (kyverno#1165) (#11258)
Signed-off-by: kiyanser <sergey.kiyan@strabag.com>
Co-authored-by: kiyanser <sergey.kiyan@strabag.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-11-20 10:15:03 +00:00
Mariam Fahmy
80ad66b34f
fix: use ephemeralreportsfor reports controller in helm (#11600)
Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-11-18 08:41:59 +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
Patrik Votoček
e49d04be10
fix(chart): correct behavior for global image registry (#11482)
Signed-off-by: Patrik Votoček <patrik@votocek.cz>
2024-11-01 11:19:02 +00:00
shuting
8cc5215518
fix: switch configmap removal to use post-delete helm hook (#11504)
Signed-off-by: ShutingZhao <shuting@nirmata.com>
2024-10-31 20:42:33 -07:00
Mariam Fahmy
2ff41d10ca
fix: add emitWarning field in v2beta1 (#11489)
* fix: add emitWarning field in v2beta1

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

* fix: add artificathub changes

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

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-10-30 15:17:59 +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
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
Ammar Yasser
9a8e35d787
Selector with mutate target (#11208)
* feature: Add LabelSelector as a field of resource spec to allow fetching by labels

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

* chore: Generate CRDs

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

* feat: Add the capability to fetch with label selector

- Add the label selector as a parameter to GetResources of the engine api client and the dclient.
- Use the label selector with list options in the dclient.
- convert a metav1.LabelSelector to a labels.Selector before fetching to be able to convert it to a string to be used with ListOptions.

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

* feat: Pass label selector to the GetResources method

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

* feat: Return the resource selector when resolving spec

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

* fix: Instantiate the fake client schema using the passed gvrToListKind map and by inferring schema from passed resources

All tests that use List will fail because the fake client doesn't infer the schema from the passed resources.
gvrToListKind can't be fully deprecated as some parts of kyverno use the fake client without passing resources to it (resource generation). And so both approaches have to be supported.

References:
- https://github.com/kubernetes/client-go/issues/983
- 46c1ad3baa

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

* test: Add labelSelector unit test to mutate existing test.

- Remove the unwanted call to GetResource.
- Pass an empty map of GVR to string to the fake client constructor.

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

* test: Add chainsaw test

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

* chore: Run codegen

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

* chore: Generate helm CRDs

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

* refactor: Put the LabelSelector in a separate struct

Many types use the ResourceSpec struct and not all of them support label selectors.
This removes the field into a separate schema dedicated to target selection called TargetSelector.
It has the ResourceSpec and the selector.

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

* chore: Run codegen after modifying selector comment

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

* chore: Run codegen

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

---------

Signed-off-by: aerosouund <aerosound161@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-10-16 11:17:08 +00: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
Vishal Choudhary
21fd92e3e4
feat: add --backgroundReports flag to disable mutateexisting and generate reporting (#11361)
Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
2024-10-09 10:43:59 +00:00
Jim Bugwadia
2289720ba0
add support for shallow substitution (#11058)
* add support for shallow substitution

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* linter issue

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* exclude EphemeralReport and ClusterEphemeralReport

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

* update codegen

Signed-off-by: Jim Bugwadia <jim@nirmata.com>

---------

Signed-off-by: Jim Bugwadia <jim@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-10-08 19:43:04 +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