2023-12-07 22:38:30 +01:00
|
|
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
|
|
|
kind: Test
|
|
|
|
metadata:
|
|
|
|
name: simple-conditional
|
|
|
|
spec:
|
|
|
|
steps:
|
2024-10-03 17:08:36 +02:00
|
|
|
- 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: set-runasnonroot-true
|
2023-12-07 22:38:30 +01:00
|
|
|
- name: step-02
|
|
|
|
try:
|
|
|
|
- apply:
|
|
|
|
file: pod1.yaml
|
|
|
|
- assert:
|
|
|
|
file: pod1-mutated.yaml
|
|
|
|
- name: step-03
|
|
|
|
try:
|
|
|
|
- apply:
|
|
|
|
file: pod2.yaml
|
|
|
|
- assert:
|
|
|
|
file: pod2-mutated.yaml
|