2023-12-05 23:28:28 +01:00
|
|
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
|
|
|
kind: Test
|
|
|
|
metadata:
|
|
|
|
name: foreach-jsonpatch
|
|
|
|
spec:
|
|
|
|
steps:
|
2024-09-17 11:28:33 +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: mutate-pod-require-non-root-user
|
|
|
|
- name: check autogen
|
2023-12-05 23:28:28 +01:00
|
|
|
try:
|
|
|
|
- assert:
|
2024-09-17 11:28:33 +02:00
|
|
|
file: check-autogen.yaml
|
|
|
|
- name: detect errors
|
|
|
|
try:
|
2023-12-05 23:28:28 +01:00
|
|
|
- error:
|
|
|
|
file: policy-error.yaml
|