1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-28 02:18:15 +00:00

chore: enable all chainsaw tests (#9012)

* chore: enable all chainsaw tests

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* bump chainsaw

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fixes

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* fix

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-11-24 19:49:40 +01:00 committed by GitHub
parent 86dff69edc
commit 5a47d301e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 142 additions and 63 deletions

View file

@ -184,17 +184,17 @@ jobs:
- events
- exceptions
- filter
# - generate/clusterpolicy
# - generate/policy
# - generate/validation
# - mutate
# - policy-validation
- generate/clusterpolicy
- generate/policy
- generate/validation
- mutate
- policy-validation
- rangeoperators
- rbac
# - reports
# - validate
# - verify-manifests
# - verifyImages
- reports
- validate
- verify-manifests
- verifyImages
- webhooks
needs: prepare-images
name: chainsaw - ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
@ -236,7 +236,7 @@ jobs:
- name: Install Chainsaw
uses: kyverno/chainsaw/.github/actions/install@c08ae80bc45546987edff33212bf33161c84ce59 # v0.0.6
with:
release: v0.0.6
release: v0.0.7-alpha.2
- name: Test with Chainsaw
shell: bash
env:

View file

@ -7,8 +7,8 @@ spec:
assert: 90s
cleanup: 150s
error: 90s
exec: 90s
exec: 150s
parallel: 1
fullName: true
failFast: true
failFast: false
excludeTestRegex: '_.+'

View file

@ -0,0 +1,18 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- command:
args:
- delete
- -f
- 01-manifests.yaml
- --force
- --wait=true
- --ignore-not-found=true
entrypoint: kubectl

View file

@ -1,4 +0,0 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true

View file

@ -0,0 +1,18 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- command:
args:
- delete
- -f
- 01-manifests.yaml
- --force
- --wait=true
- --ignore-not-found=true
entrypoint: kubectl

View file

@ -1,4 +0,0 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true

View file

@ -0,0 +1,18 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- command:
args:
- delete
- -f
- 01-manifests.yaml
- --force
- --wait=true
- --ignore-not-found=true
entrypoint: kubectl

View file

@ -1,4 +0,0 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true

View file

@ -0,0 +1,18 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- command:
args:
- delete
- -f
- 01-manifests.yaml
- --force
- --wait=true
- --ignore-not-found=true
entrypoint: kubectl

View file

@ -1,4 +0,0 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true

View file

@ -0,0 +1,18 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- command:
args:
- delete
- -f
- 01-manifests.yaml
- --force
- --wait=true
- --ignore-not-found=true
entrypoint: kubectl

View file

@ -1,4 +0,0 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- command: kubectl delete -f 01-manifests.yaml --force --wait=true --ignore-not-found=true

View file

@ -6,4 +6,4 @@ spec:
containers:
- name: busybox
image: busybox:1.35
env: null
(env != null): true

View file

@ -6,7 +6,7 @@ spec:
containers:
- name: busybox-1
image: busybox:1.35
env: null
(env != null): true
- name: busybox-2
image: busybox:1.35
env: null
(env != null): true

View file

@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: policy_exception
name: policy-exception
spec:
timeouts: {}
try:

View file

@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: namespaceConstraint
name: namespace-constraint
spec:
timeouts: {}
try:

View file

@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: nameConstraint
name: name-constraint
spec:
timeouts: {}
try:

View file

@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: replicaLimit
name: replica-limit
spec:
timeouts: {}
try:

View file

@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: replicaLimit
name: replica-limit
spec:
timeouts: {}
try:

View file

@ -0,0 +1,10 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
name: policy
spec:
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml

View file

@ -1,11 +0,0 @@
---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: preconditions
status:
conditions:
- reason: Succeeded
status: "True"
type: Ready

View file

@ -1,11 +1,9 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: test
spec:
timeouts: {}
try:
- apply:
file: pod-good.yaml

View file

@ -1,13 +1,13 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: cleanup
spec:
timeouts: {}
try:
- delete:
apiVersion: v1
kind: Pod
name: test
timeout: 1m
- apply:
file: policy-2.yaml

View file

@ -1,4 +1,3 @@
---
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
@ -8,4 +7,3 @@ status:
- reason: Succeeded
status: "True"
type: Ready

View file

@ -0,0 +1,7 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: multiple-attestors
spec:
timeouts:
apply: 90s

View file

@ -1,5 +1,11 @@
apiVersion: kuttl.dev/v1beta1
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
commands:
- command: kubectl -n verify-images rollout undo deployment nginx-deployment
namespaced: true
metadata:
creationTimestamp: null
name: test
spec:
timeouts: {}
try:
- script:
content: kubectl -n verify-images rollout undo deployment nginx-deployment

View file

@ -9,5 +9,7 @@ spec:
try:
- apply:
file: resource-v1.yaml
timeout: 90s
- apply:
file: resource-v2.yaml
timeout: 90s