mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-10 01:46:55 +00:00
28 lines
709 B
YAML
28 lines
709 B
YAML
apiVersion: chainsaw.kyverno.io/v1alpha1
|
|
kind: Test
|
|
metadata:
|
|
name: test-emit-warning
|
|
spec:
|
|
steps:
|
|
- name: create policy
|
|
use:
|
|
template: ../../../_step-templates/create-policy.yaml
|
|
with:
|
|
bindings:
|
|
- name: file
|
|
value: policy.yaml
|
|
- name: wait policy ready
|
|
use:
|
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
|
with:
|
|
bindings:
|
|
- name: name
|
|
value: add-labels
|
|
- 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"
|