1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/test/conformance/chainsaw/globalcontext/validate-crd/chainsaw-test.yaml

30 lines
980 B
YAML
Raw Normal View History

---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
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): |-
GlobalContextEntry.kyverno.io "ingress-2" is invalid: <nil>: Invalid value: "": "spec" must validate one and only one schema (oneOf). Found 2 valid alternatives
- name: step-03
try:
- apply:
file: no-resource.yaml
expect:
- check:
($error): |-
GlobalContextEntry.kyverno.io "ingress-3" is invalid: [<nil>: Invalid value: "": "spec" must validate one and only one schema (oneOf). Found none valid, spec.kubernetesResource: Required value]