2023-12-06 22:39:17 +01:00
|
|
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
|
|
|
kind: Test
|
|
|
|
metadata:
|
|
|
|
name: events-creation
|
|
|
|
spec:
|
|
|
|
steps:
|
2024-10-03 13:56:30 +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: disallow-latest-tag-events-creation
|
2023-12-06 22:39:17 +01:00
|
|
|
- name: step-02
|
|
|
|
try:
|
|
|
|
- apply:
|
|
|
|
file: chainsaw-step-02-apply-1.yaml
|
|
|
|
- apply:
|
|
|
|
file: chainsaw-step-02-apply-2.yaml
|
|
|
|
- name: step-03
|
|
|
|
try:
|
|
|
|
- apply:
|
|
|
|
file: chainsaw-step-03-apply-1.yaml
|
|
|
|
- apply:
|
|
|
|
file: chainsaw-step-03-apply-2.yaml
|
|
|
|
- name: step-04
|
|
|
|
try:
|
|
|
|
- sleep:
|
|
|
|
duration: 3s
|
|
|
|
- name: step-05
|
|
|
|
try:
|
|
|
|
- assert:
|
|
|
|
file: chainsaw-step-05-assert-1.yaml
|
|
|
|
- assert:
|
|
|
|
file: chainsaw-step-05-assert-2.yaml
|