1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 09:26:54 +00:00
kyverno/test/conformance/kuttl/generate/validation/policy/prevent-loop
shuting f87b0204e6
fix: generate policy validation to prevent endless loop (#7026)
* refactor policy validation

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

* add loop check for generate

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

* add kuttl tests

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

* linter fixes

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

* linter fixes

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

---------

Signed-off-by: ShutingZhao <shuting@nirmata.com>
2023-04-28 13:54:17 +00:00
..
01-fail.yaml fix: generate policy validation to prevent endless loop (#7026) 2023-04-28 13:54:17 +00:00
policy.yaml fix: generate policy validation to prevent endless loop (#7026) 2023-04-28 13:54:17 +00:00
README.md fix: generate policy validation to prevent endless loop (#7026) 2023-04-28 13:54:17 +00:00

Description

This test ensures that a generate policy cannot have the same kind defined in the trigger and the target resources. Otherwise it would result in an endless loop.

Expected Behavior

The test fails if the policy creation is allowed, otherwise passes.

Reference Issue(s)

https://github.com/kyverno/kyverno/issues/7017