mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 18:06:55 +00:00
30 lines
1,006 B
YAML
30 lines
1,006 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): |-
|
|
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]
|