1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 18:06:55 +00:00
kyverno/test/conformance/chainsaw/policy-validation/cluster-policy/cel-expressions/chainsaw-test.yaml
Mariam Fahmy 3510998d4f
feat: Support CEL expression warnings (#9566)
* feat: support CEL expression warnings

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

* fix

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

* fix: allow the policy creation but return warnings to the API server

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

* fix tests

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

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
2024-02-02 10:04:02 +00:00

23 lines
788 B
YAML
Executable file

apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: cel-expressions
spec:
steps:
- name: Apply the first policy
try:
- script:
content: kubectl apply -f policy-1.yaml
check:
# This check ensures that the string "undefined field 'automountServiceAccountToken';" is found
# in stderr or else fails
(contains($stderr, 'undefined field \'automountServiceAccountToken\';')): true
- name: Apply the second policy
try:
- script:
content: kubectl apply -f policy-2.yaml
check:
# This check ensures that the string "undefined field 'replicas';" is found
# in stderr or else fails
(contains($stderr, 'undefined field \'replicas\';')): true