1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-10 09:56:55 +00:00
kyverno/test/conformance/chainsaw/policy-validation/cluster-policy/deprecated-operations/chainsaw-test.yaml

35 lines
1,021 B
YAML
Raw Normal View History

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