--- apiVersion: chainsaw.kyverno.io/v1alpha1 kind: TestStep metadata: creationTimestamp: null name: script spec: timeouts: {} try: - script: content: "if kubectl patch ConfigMap test-configmap -n test-validate-e2e-adding-key-to-config-map --type='json' -p=\"[{\\\"op\\\": \\\"add\\\", \\\"path\\\": \\\"/data/lock\\\", \\\"value\\\":\"\"admin\"\"}]\" 2>&1 | grep -q 'validation error: Configmap key must be \"abc\"' \nthen \n echo \"Test succeeded. Resource was blocked from adding key.\"\n exit 0\nelse \n echo \"Tested failed. Resource was not blocked from adding key.\"\n exit 1 \nfi\n"