2025-02-03 13:53:57 +01:00
|
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
|
|
|
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
|
|
|
kind: Test
|
|
|
|
metadata:
|
2025-02-14 15:35:41 +02:00
|
|
|
name: with-match-conditions
|
2025-02-03 13:53:57 +01:00
|
|
|
spec:
|
|
|
|
steps:
|
|
|
|
- name: create policy
|
|
|
|
try:
|
|
|
|
- create:
|
|
|
|
file: policy.yaml
|
2025-03-18 18:40:21 +08:00
|
|
|
- assert:
|
|
|
|
file: policy-assert.yaml
|
2025-02-14 15:35:41 +02:00
|
|
|
- name: create good pod
|
2025-02-03 13:53:57 +01:00
|
|
|
try:
|
2025-02-14 15:35:41 +02:00
|
|
|
- create:
|
|
|
|
file: good-pod.yaml
|
|
|
|
- name: create bad pod
|
|
|
|
try:
|
|
|
|
- create:
|
|
|
|
file: bad-pod.yaml
|
|
|
|
expect:
|
|
|
|
- check:
|
|
|
|
($error != null): true
|