1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

fix: chainsaw test (#9148)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-12-13 10:24:00 +01:00 committed by GitHub
parent a67d05399e
commit 4564e1de8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 76 deletions

View file

@ -1,13 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: badpod
spec:
timeouts: {}
try:
- apply:
file: bad-pod.yaml
- assert:
file: bad-pod-ready.yaml

View file

@ -1,13 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: policy
spec:
timeouts: {}
try:
- apply:
file: policy.yaml
- assert:
file: policy-ready.yaml

View file

@ -1,13 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: goodpod
spec:
timeouts: {}
try:
- apply:
file: good-pod.yaml
- assert:
file: good-pod-ready.yaml

View file

@ -1,13 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: badpod
spec:
timeouts: {}
try:
- script:
content: ./bad-pod-update-test.sh
timeout: 30s

View file

@ -1,12 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: badpod
spec:
timeouts: {}
try:
- script:
content: ./good-pod-update-test.sh
timeout: 30s

View file

@ -1,12 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: badtogoodpod
spec:
timeouts: {}
try:
- script:
content: ./update-bad-pod-to-comply.sh
timeout: 30s

View file

@ -0,0 +1,40 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: enforce-validate-existing
spec:
steps:
- name: step-01
try:
- apply:
file: bad-pod.yaml
- assert:
file: bad-pod-ready.yaml
- name: step-02
try:
- apply:
file: policy.yaml
- assert:
file: policy-ready.yaml
- name: step-03
try:
- apply:
file: good-pod.yaml
- assert:
file: good-pod-ready.yaml
- name: step-04
try:
- script:
content: ./bad-pod-update-test.sh
timeout: 30s
- name: step-05
try:
- script:
content: ./good-pod-update-test.sh
timeout: 30s
- name: step-06
try:
- script:
content: ./update-bad-pod-to-comply.sh
timeout: 30s