2023-11-24 11:17:58 +01:00
|
|
|
## Description
|
|
|
|
|
2024-01-31 00:41:13 +01:00
|
|
|
This test updates the deployment with flag `--omitEvents=PolicyApplied` set
|
2023-11-24 11:17:58 +01:00
|
|
|
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
|
|
|
|
|
2024-01-31 00:41:13 +01:00
|
|
|
1. Update the deployment of admission controller to add this ar`--omitEvents=PolicyApplied`.
|
2023-11-24 11:17:58 +01:00
|
|
|
2. - Create a policy
|
|
|
|
- Assert the policy becomes ready
|
|
|
|
3. - Create a resource,
|
|
|
|
4. - Asset a `PolicyApplied` event is created
|
|
|
|
5. Try creating a resource with a script that is expected to fail.
|
|
|
|
6. Exit the script with `0` if it returns an error
|