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

chore: convert chainsaw tests to Test resource (#9100)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-12-06 22:39:17 +01:00 committed by GitHub
parent b4eebc5073
commit f2561d0095
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 735 additions and 1064 deletions

View file

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

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: testcase
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: deploy.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: dependencies
spec:
steps:
- name: step-01
try:
- apply:
file: manifests.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: deploy.yaml

View file

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

View file

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

View file

@ -0,0 +1,19 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: foreach
spec:
steps:
- name: step-01
try:
- apply:
file: manifests.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: cm.yaml
- assert:
file: cm-assert.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-assert.yaml

View file

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

View file

@ -0,0 +1,19 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: recursive
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- assert:
file: resource-assert.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-assert.yaml

View file

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

View file

@ -0,0 +1,19 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: resolve-overriden-variable
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- assert:
file: resource-assert.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-assert.yaml

View file

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

View file

@ -0,0 +1,19 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: two-rules
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- assert:
file: resource-assert.yaml

View file

@ -1,13 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: crd
spec:
timeouts: {}
try:
- apply:
file: crd.yaml
- assert:
file: crd-assert.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-assert.yaml

View file

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

View file

@ -1,11 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: sleep
spec:
timeouts: {}
try:
- sleep:
duration: 3s

View file

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

View file

@ -0,0 +1,31 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: generate-events-upon-fail-generation
spec:
steps:
- name: step-01
try:
- apply:
file: crd.yaml
- assert:
file: crd-assert.yaml
- name: step-02
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-03
try:
- apply:
file: resource.yaml
- name: step-04
try:
- sleep:
duration: 3s
- name: step-05
try:
- assert:
file: event.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-assert.yaml

View file

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

View file

@ -1,11 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: sleep
spec:
timeouts: {}
try:
- sleep:
duration: 3s

View file

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

View file

@ -0,0 +1,27 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: generate-events-upon-successful-generation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- name: step-03
try:
- sleep:
duration: 3s
- name: step-04
try:
- assert:
file: policy-event.yaml
- assert:
file: resource-event.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-assert.yaml

View file

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

View file

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

View file

@ -0,0 +1,21 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: generate-events-upon-successful-mutation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- name: step-03
try:
- assert:
file: event-assert.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-assert.yaml

View file

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

View file

@ -1,11 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: event
spec:
timeouts: {}
try:
- error:
file: event.yaml

View file

@ -0,0 +1,21 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: no-events-upon-skip-generation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- name: step-03
try:
- error:
file: event.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-assert.yaml

View file

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

View file

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

View file

@ -0,0 +1,21 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: policy-applied
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml
- name: step-03
try:
- assert:
file: event-assert.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-assert.yaml

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: resource
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml

View file

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

View file

@ -0,0 +1,24 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: policy-violation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml
- name: step-03
try:
- assert:
file: event-assert.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-assert.yaml

View file

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

View file

@ -1,20 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: configmap
spec:
timeouts: {}
try:
- apply:
file: configmap-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: configmap-rejected.yaml
- assert:
file: configmap-allowed.yaml
- error:
file: configmap-rejected.yaml

View file

@ -0,0 +1,30 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: allows-rejects-creation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: exception.yaml
- name: step-03
try:
- apply:
file: configmap-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: configmap-rejected.yaml
- assert:
file: configmap-allowed.yaml
- error:
file: configmap-rejected.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-assert.yaml

View file

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

View file

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

View file

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

View file

@ -1,15 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: delete
spec:
timeouts: {}
try:
- delete:
ref:
apiVersion: apps/v1
kind: Deployment
name: test-dpl1
namespace: reza-dev

View file

@ -0,0 +1,33 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: applies-to-delete
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: exception.yaml
- name: step-03
try:
- apply:
file: namespace.yaml
- name: step-04
try:
- apply:
file: deployment.yaml
- name: step-05
try:
- delete:
ref:
apiVersion: apps/v1
kind: Deployment
name: test-dpl1
namespace: reza-dev

View file

@ -1,20 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: exception
spec:
timeouts: {}
try:
- apply:
file: exception-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: exception-rejected.yaml
- assert:
file: exception-allowed.yaml
- error:
file: exception-rejected.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: standard
spec:
steps:
- name: step-01
try:
- apply:
file: exception-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: exception-rejected.yaml
- assert:
file: exception-allowed.yaml
- error:
file: exception-rejected.yaml

View file

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

View file

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

View file

@ -1,19 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: deployment
spec:
timeouts: {}
try:
- apply:
file: good-deployment.yaml
- apply:
expect:
- check:
($error != null): true
file: bad-deployment.yaml
finally:
- sleep:
duration: 5s

View file

@ -0,0 +1,27 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: conditions
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- name: step-02
try:
- apply:
file: exception.yaml
- finally:
- sleep:
duration: 5s
name: step-03
try:
- apply:
file: good-deployment.yaml
- apply:
expect:
- check:
($error != null): true
file: bad-deployment.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-assert.yaml

View file

@ -1,20 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: policy-exception-events-creation-polex-ns
---
apiVersion: kyverno.io/v2beta1
kind: PolicyException
metadata:
name: policy-exception-allow-latest
namespace: policy-exception-events-creation-polex-ns
spec:
exceptions:
- policyName: disallow-latest-tag-events-creation
ruleNames:
- validate-image-tag
match:
any:
- resources:
namespaces:
- policy-exception-events-creation-ns

View file

@ -1,11 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: sleep
spec:
timeouts: {}
try:
- sleep:
duration: 3s

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: policy-exception-events-creation-polex-ns

View file

@ -0,0 +1,15 @@
apiVersion: kyverno.io/v2beta1
kind: PolicyException
metadata:
name: policy-exception-allow-latest
namespace: policy-exception-events-creation-polex-ns
spec:
exceptions:
- policyName: disallow-latest-tag-events-creation
ruleNames:
- validate-image-tag
match:
any:
- resources:
namespaces:
- policy-exception-events-creation-ns

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: policy-exception-events-creation-ns

View file

@ -1,9 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: policy-exception-events-creation-ns
---
apiVersion: v1
kind: Pod
metadata:
name: policy-exception-events-creation-pod
@ -12,4 +7,3 @@ spec:
containers:
- image: nginx
name: nginx

View file

@ -10,15 +10,3 @@ metadata:
reason: PolicySkipped
reportingComponent: kyverno-admission
type: Normal
---
apiVersion: v1
involvedObject:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
name: disallow-latest-tag-events-creation
kind: Event
metadata:
namespace: default
reason: PolicySkipped
reportingComponent: kyverno-admission
type: Normal

View file

@ -0,0 +1,11 @@
apiVersion: v1
involvedObject:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
name: disallow-latest-tag-events-creation
kind: Event
metadata:
namespace: default
reason: PolicySkipped
reportingComponent: kyverno-admission
type: Normal

View file

@ -0,0 +1,35 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: events-creation
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- 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

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-assert.yaml

View file

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

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: configmap
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: configmap.yaml

View file

@ -0,0 +1,24 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: only-for-specific-user
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: exception.yaml
- name: step-03
try:
- apply:
expect:
- check:
($error != null): true
file: configmap.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-assert.yaml

View file

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

View file

@ -1,20 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: configmap
spec:
timeouts: {}
try:
- apply:
file: configmap-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: configmap-rejected.yaml
- assert:
file: configmap-allowed.yaml
- error:
file: configmap-rejected.yaml

View file

@ -0,0 +1,30 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: with-wildcard
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: exception.yaml
- name: step-03
try:
- apply:
file: configmap-allowed.yaml
- apply:
expect:
- check:
($error != null): true
file: configmap-rejected.yaml
- assert:
file: configmap-allowed.yaml
- error:
file: configmap-rejected.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-assert.yaml

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: resource
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: no-wildcard
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: resource.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-assert.yaml

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: resource
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: wildcard
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: resource.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-assert.yaml

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: resource
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: block
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: resource.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-assert.yaml

View file

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

View file

@ -0,0 +1,17 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: pass
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.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-assert.yaml

View file

@ -1,14 +0,0 @@
---
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: TestStep
metadata:
creationTimestamp: null
name: resource
spec:
timeouts: {}
try:
- apply:
expect:
- check:
($error != null): true
file: resource.yaml

View file

@ -0,0 +1,20 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: block
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
expect:
- check:
($error != null): true
file: resource.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-assert.yaml

View file

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

View file

@ -0,0 +1,17 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: pass
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.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-assert.yaml

View file

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

View file

@ -0,0 +1,17 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: no-wildcard
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.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-assert.yaml

View file

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

View file

@ -0,0 +1,17 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: wildcard
spec:
steps:
- name: step-01
try:
- apply:
file: policy.yaml
- assert:
file: policy-assert.yaml
- name: step-02
try:
- apply:
file: resource.yaml

Some files were not shown because too many files have changed in this diff Show more