mirror of
https://github.com/kyverno/kyverno.git
synced 2025-01-20 18:52:16 +00:00
f2561d0095
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> |
||
---|---|---|
.. | ||
admission-controller-assert.yaml | ||
admission-controller.yaml | ||
chainsaw-test.yaml | ||
event-assert.yaml | ||
policy-assert.yaml | ||
policy.yaml | ||
README.md | ||
resource-fail.yaml | ||
resource.yaml |
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
- 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
- Asset a
- Try creating a resource with a script that is expected to fail.
- Exit the script with
0
if it returns an error