1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/test/conformance/chainsaw/globalcontext/validate-crd/chainsaw-test.yaml
Charles-Edouard Brétéché f529ff9b85
fix: global context validation (#9643)
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-05 13:56:44 +00:00

30 lines
995 B
YAML

---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: validate-global-context-crd
spec:
steps:
- name: step-01
try:
- apply:
file: valid-context.yaml
- assert:
file: valid-context-assert.yaml
- name: step-02
try:
- apply:
file: multiple-resources.yaml
expect:
- check:
($error): |-
admission webhook "kyverno-svc.kyverno.svc" denied the request: spec.kubernetesResource: Forbidden: A global context entry should either have KubernetesResource or APICall
- name: step-03
try:
- apply:
file: no-resource.yaml
expect:
- check:
($error): |-
admission webhook "kyverno-svc.kyverno.svc" denied the request: spec.kubernetesResource: Forbidden: A global context entry should either have KubernetesResource or APICall