mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 09:56:55 +00:00
21 lines
466 B
YAML
21 lines
466 B
YAML
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
||
|
kind: Test
|
||
|
metadata:
|
||
|
name: test-emit-warning
|
||
|
spec:
|
||
|
steps:
|
||
|
- name: step-01
|
||
|
try:
|
||
|
- apply:
|
||
|
file: policy.yaml
|
||
|
- assert:
|
||
|
file: policy-assert.yaml
|
||
|
- name: step-02
|
||
|
try:
|
||
|
- script:
|
||
|
content: "kubectl apply -f pod.yaml 2>&1 | grep -q 'Warning: policy add-labels.add-labels: mutated Pod/test-pod'"
|
||
|
- name: cleanup
|
||
|
try:
|
||
|
- script:
|
||
|
content: "kubectl delete -f pod.yaml"
|