1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/kuttl/flags/standard/emit-events
Vishal Choudhary a191fa567d
Added omit-events flag to allow disabling of event emission (#7010)
* added comma seperated flag

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* reason added in logs

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* added requested changes

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* kuttl test init

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated kuttl tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated behavior

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* fixed flawed behavior

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated test location and added readme

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* tests

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* updated step

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

* omit events

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>

---------

Signed-off-by: Vishal Choudhary <sendtovishalchoudhary@gmail.com>
Co-authored-by: shuting <shuting@nirmata.com>
2023-05-10 11:48:41 +00:00
..
01-admission-controller-apply.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
02-policy.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
03-resource.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
04-event.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
05-script.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
admission-controller-assert.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
admission-controller.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
event-assert.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
policy-assert.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
policy.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
README.md Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
resource-fail.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00
resource.yaml Added omit-events flag to allow disabling of event emission (#7010) 2023-05-10 11:48:41 +00:00

Description

This test updates the deployment with flag --omit-events=PolicyApplied set Then it creates a policy, and a resource. The resource is expected to be accepted. A PolicyApplied event should be created. Then it creates a respource that is expected to be rejected A PolicyViolation event should not be emitted as the flag does not include that.

Steps

  1. Update the deployment of admission controller to add this ar--omit-events=PolicyApplied.
    • Create a policy
    • Assert the policy becomes ready
    • Create a resource,
    • Asset a PolicyApplied event is created
  2. Try creating a resource with a script that is expected to fail.
  3. Exit the script with 0 if it returns an error