mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 19:35:06 +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:
parent
86dff69edc
commit
5a47d301e1
29 changed files with 142 additions and 63 deletions
20
.github/workflows/conformance.yaml
vendored
20
.github/workflows/conformance.yaml
vendored
|
@ -184,17 +184,17 @@ jobs:
|
||||||
- events
|
- events
|
||||||
- exceptions
|
- exceptions
|
||||||
- filter
|
- filter
|
||||||
# - generate/clusterpolicy
|
- generate/clusterpolicy
|
||||||
# - generate/policy
|
- generate/policy
|
||||||
# - generate/validation
|
- generate/validation
|
||||||
# - mutate
|
- mutate
|
||||||
# - policy-validation
|
- policy-validation
|
||||||
- rangeoperators
|
- rangeoperators
|
||||||
- rbac
|
- rbac
|
||||||
# - reports
|
- reports
|
||||||
# - validate
|
- validate
|
||||||
# - verify-manifests
|
- verify-manifests
|
||||||
# - verifyImages
|
- verifyImages
|
||||||
- webhooks
|
- webhooks
|
||||||
needs: prepare-images
|
needs: prepare-images
|
||||||
name: chainsaw - ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
name: chainsaw - ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
||||||
|
@ -236,7 +236,7 @@ jobs:
|
||||||
- name: Install Chainsaw
|
- name: Install Chainsaw
|
||||||
uses: kyverno/chainsaw/.github/actions/install@c08ae80bc45546987edff33212bf33161c84ce59 # v0.0.6
|
uses: kyverno/chainsaw/.github/actions/install@c08ae80bc45546987edff33212bf33161c84ce59 # v0.0.6
|
||||||
with:
|
with:
|
||||||
release: v0.0.6
|
release: v0.0.7-alpha.2
|
||||||
- name: Test with Chainsaw
|
- name: Test with Chainsaw
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -7,8 +7,8 @@ spec:
|
||||||
assert: 90s
|
assert: 90s
|
||||||
cleanup: 150s
|
cleanup: 150s
|
||||||
error: 90s
|
error: 90s
|
||||||
exec: 90s
|
exec: 150s
|
||||||
parallel: 1
|
parallel: 1
|
||||||
fullName: true
|
fullName: true
|
||||||
failFast: true
|
failFast: false
|
||||||
excludeTestRegex: '_.+'
|
excludeTestRegex: '_.+'
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
|
@ -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
|
|
@ -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
|
|
|
@ -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
|
|
@ -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
|
|
|
@ -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
|
|
@ -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
|
|
|
@ -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
|
|
@ -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
|
|
|
@ -6,4 +6,4 @@ spec:
|
||||||
containers:
|
containers:
|
||||||
- name: busybox
|
- name: busybox
|
||||||
image: busybox:1.35
|
image: busybox:1.35
|
||||||
env: null
|
(env != null): true
|
||||||
|
|
|
@ -6,7 +6,7 @@ spec:
|
||||||
containers:
|
containers:
|
||||||
- name: busybox-1
|
- name: busybox-1
|
||||||
image: busybox:1.35
|
image: busybox:1.35
|
||||||
env: null
|
(env != null): true
|
||||||
- name: busybox-2
|
- name: busybox-2
|
||||||
image: busybox:1.35
|
image: busybox:1.35
|
||||||
env: null
|
(env != null): true
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: policy_exception
|
name: policy-exception
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: namespaceConstraint
|
name: namespace-constraint
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: nameConstraint
|
name: name-constraint
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: replicaLimit
|
name: replica-limit
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3,7 +3,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: replicaLimit
|
name: replica-limit
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
timeouts: {}
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -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
|
|
@ -1,11 +0,0 @@
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: preconditions
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
---
|
|
||||||
apiVersion: chainsaw.kyverno.io/v1alpha1
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: test
|
name: test
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
file: pod-good.yaml
|
file: pod-good.yaml
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
|
||||||
apiVersion: chainsaw.kyverno.io/v1alpha1
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
|
||||||
name: cleanup
|
name: cleanup
|
||||||
spec:
|
spec:
|
||||||
timeouts: {}
|
|
||||||
try:
|
try:
|
||||||
- delete:
|
- delete:
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
name: test
|
name: test
|
||||||
|
timeout: 1m
|
||||||
|
- apply:
|
||||||
|
file: policy-2.yaml
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
apiVersion: kyverno.io/v1
|
||||||
kind: ClusterPolicy
|
kind: ClusterPolicy
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -8,4 +7,3 @@ status:
|
||||||
- reason: Succeeded
|
- reason: Succeeded
|
||||||
status: "True"
|
status: "True"
|
||||||
type: Ready
|
type: Ready
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
apiVersion: kyverno.io/v1
|
||||||
kind: ClusterPolicy
|
kind: ClusterPolicy
|
||||||
metadata:
|
metadata:
|
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
|
kind: Test
|
||||||
|
metadata:
|
||||||
|
name: multiple-attestors
|
||||||
|
spec:
|
||||||
|
timeouts:
|
||||||
|
apply: 90s
|
|
@ -1,5 +1,11 @@
|
||||||
apiVersion: kuttl.dev/v1beta1
|
---
|
||||||
|
apiVersion: chainsaw.kyverno.io/v1alpha1
|
||||||
kind: TestStep
|
kind: TestStep
|
||||||
commands:
|
metadata:
|
||||||
- command: kubectl -n verify-images rollout undo deployment nginx-deployment
|
creationTimestamp: null
|
||||||
namespaced: true
|
name: test
|
||||||
|
spec:
|
||||||
|
timeouts: {}
|
||||||
|
try:
|
||||||
|
- script:
|
||||||
|
content: kubectl -n verify-images rollout undo deployment nginx-deployment
|
||||||
|
|
|
@ -9,5 +9,7 @@ spec:
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
file: resource-v1.yaml
|
file: resource-v1.yaml
|
||||||
|
timeout: 90s
|
||||||
- apply:
|
- apply:
|
||||||
file: resource-v2.yaml
|
file: resource-v2.yaml
|
||||||
|
timeout: 90s
|
||||||
|
|
Loading…
Add table
Reference in a new issue