1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 01:46:55 +00:00
kyverno/test/conformance/chainsaw/policy-validation/cluster-policy/deprecated-operations/chainsaw-test.yaml
Vishal Choudhary 82b65aebc4
feat: add fail/warn on deprecated/invalid operators (#8624)
* feat: add fail/warn on deprecated/invalid operators

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: nested for each

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

* fix: chainsaw-test.yaml

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>

---------

Signed-off-by: Vishal Choudhary <vishal.choudhary@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
2024-01-31 08:40:28 +00:00

34 lines
1,021 B
YAML

apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: background-variables-update
spec:
steps:
- name: step-01
try:
- script:
content: |
if kubectl apply -f policy-deprecated-operator.yaml 2>&1 | grep -q "Warning: Operator NotIn has been deprecated and will be removed soon."
then
echo "Test succeeded. Warning was displayed."
exit 0
else
echo "Tested failed. Warning was not displayed."
exit 1
fi
- name: step-01
try:
- script:
content: |
mkfifo test-pipe
if kubectl apply -f policy-invalid-operator.yaml 2> test-pipe | grep -q "entered value of \`operator\` is invalid" test-pipe
then
echo "Test succeeded. Warning was displayed."
rm test-pipe
exit 0
else
echo "Tested failed. Warning was not displayed."
rm test-pipe
exit 1
fi