mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
feat: use more chainsaw test templates (#11285)
* feat: use more chainsaw test templates 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>
This commit is contained in:
parent
fe49e97fba
commit
fa36573f85
25 changed files with 182 additions and 206 deletions
|
@ -12,12 +12,20 @@ spec:
|
||||||
file: permissions.yaml
|
file: permissions.yaml
|
||||||
- assert:
|
- assert:
|
||||||
file: crd-assert.yaml
|
file: crd-assert.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: rbac-policy
|
||||||
- name: step-03
|
- name: step-03
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: rbac-policy
|
|
||||||
spec: {}
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -10,12 +10,20 @@ spec:
|
||||||
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
||||||
- assert:
|
- assert:
|
||||||
file: kyverno-configmap-assert.yaml
|
file: kyverno-configmap-assert.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: zk-kafka-address
|
||||||
- name: step-03
|
- name: step-03
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: zk-kafka-address
|
|
||||||
spec: {}
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -10,12 +10,20 @@ spec:
|
||||||
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
||||||
- assert:
|
- assert:
|
||||||
file: kyverno-configmap-assert.yaml
|
file: kyverno-configmap-assert.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: add-labels
|
||||||
- name: step-03
|
- name: step-03
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: add-labels
|
|
||||||
spec: {}
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,20 @@ metadata:
|
||||||
name: message-exceeds-1024-characters
|
name: message-exceeds-1024-characters
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: podsecurity-subrule-restricted
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: podsecurity-subrule-restricted
|
|
||||||
spec: {}
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,20 @@ metadata:
|
||||||
name: no-events-upon-skip-generation
|
name: no-events-upon-skip-generation
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: default
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: default
|
|
||||||
spec: {}
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -10,12 +10,20 @@ spec:
|
||||||
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
||||||
- assert:
|
- assert:
|
||||||
file: kyverno-configmap-assert.yaml
|
file: kyverno-configmap-assert.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
- name: step-03
|
- name: step-03
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: Policy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -10,12 +10,20 @@ spec:
|
||||||
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
content: kubectl patch configmap kyverno -p '{"data":{"generateSuccessEvents":"true"}}' -n kyverno
|
||||||
- assert:
|
- assert:
|
||||||
file: kyverno-configmap-assert.yaml
|
file: kyverno-configmap-assert.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
- name: step-03
|
- name: step-03
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: Policy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,20 @@ metadata:
|
||||||
name: policy-violation
|
name: policy-violation
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: Policy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,20 @@ metadata:
|
||||||
name: policy-violation
|
name: policy-violation
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: Policy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,27 @@ metadata:
|
||||||
name: fail
|
name: fail
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: add-labels
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: add-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -4,12 +4,27 @@ metadata:
|
||||||
name: fail
|
name: fail
|
||||||
spec:
|
spec:
|
||||||
steps:
|
steps:
|
||||||
- name: step-01
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: require-labels
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: add-labels
|
||||||
- name: step-02
|
- name: step-02
|
||||||
try:
|
try:
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: require-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: add-labels
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -8,9 +8,17 @@ spec:
|
||||||
try:
|
try:
|
||||||
- apply:
|
- apply:
|
||||||
file: clusterrole.yaml
|
file: clusterrole.yaml
|
||||||
- name: step-02
|
- name: create policy
|
||||||
try:
|
use:
|
||||||
- apply:
|
template: ../../_step-templates/create-policy.yaml
|
||||||
file: policy.yaml
|
with:
|
||||||
- assert:
|
bindings:
|
||||||
file: policy-assert.yaml
|
- name: file
|
||||||
|
value: policy.yaml
|
||||||
|
- name: wait policy ready
|
||||||
|
use:
|
||||||
|
template: ../../_step-templates/cluster-policy-ready.yaml
|
||||||
|
with:
|
||||||
|
bindings:
|
||||||
|
- name: name
|
||||||
|
value: policy-reload-on-secret-update
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
apiVersion: kyverno.io/v1
|
|
||||||
kind: ClusterPolicy
|
|
||||||
metadata:
|
|
||||||
name: policy-reload-on-secret-update
|
|
||||||
status:
|
|
||||||
conditions:
|
|
||||||
- reason: Succeeded
|
|
||||||
status: "True"
|
|
||||||
type: Ready
|
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
|
||||||
apiVersion: kyverno.io/v1
|
apiVersion: kyverno.io/v1
|
||||||
kind: ClusterPolicy
|
kind: ClusterPolicy
|
||||||
metadata:
|
metadata:
|
||||||
|
|
Loading…
Add table
Reference in a new issue