From decb7524eb306d198536ed466fabbcd674852af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 3 Oct 2024 12:53:14 +0200 Subject: [PATCH] chore: use more chainsaw step templates (#11308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .../admission/exception/chainsaw-test.yaml | 20 +++++-- .../admission/exception/policy-assert.yaml | 9 --- .../mutation/chainsaw-step-01-assert-1-1.yaml | 9 --- .../admission/mutation/chainsaw-test.yaml | 20 +++++-- ...saw-step-01-apply-1-1.yaml => policy.yaml} | 0 .../chainsaw-test.yaml | 20 +++++-- .../policy-assert.yaml | 9 --- .../namespaceselector/chainsaw-test.yaml | 20 +++++-- .../namespaceselector/policy-assert.yaml | 9 --- .../chainsaw-step-01-assert-1.yaml | 9 --- .../chainsaw-test.yaml | 20 +++++-- ...insaw-step-01-apply-1.yaml => policy.yaml} | 0 .../chainsaw-step-01-assert-1.yaml | 9 --- .../test-report-audit-warn/chainsaw-test.yaml | 20 +++++-- ...insaw-step-01-apply-1.yaml => policy.yaml} | 0 .../chainsaw-step-01-assert-1.yaml | 9 --- .../test-report-properties/chainsaw-test.yaml | 20 +++++-- ...insaw-step-01-apply-1.yaml => policy.yaml} | 0 .../chainsaw-test.yaml | 60 +++++++++++-------- .../policy-assert.yaml | 9 --- .../update-deployment/chainsaw-test.yaml | 20 +++++-- .../update-deployment/policy-assert.yaml | 9 --- .../admission/update/chainsaw-test.yaml | 20 +++++-- .../admission/update/policy-assert.yaml | 9 --- .../exception-assert/chainsaw-test.yaml | 20 +++++-- .../exception-assert/policy-assert.yaml | 9 --- .../chainsaw-test.yaml | 20 +++++-- .../policy-assert.yaml | 9 --- .../chainsaw-test.yaml | 20 +++++-- .../policy-assert.yaml | 9 --- .../background/exception/chainsaw-test.yaml | 20 +++++-- .../background/exception/policy-assert.yaml | 9 --- .../generate/chainsaw-step-01-assert-1-1.yaml | 9 --- .../background/generate/chainsaw-test.yaml | 19 ++++-- ...saw-step-01-apply-1-1.yaml => policy.yaml} | 0 .../chainsaw-test.yaml | 20 +++++-- .../policy-assert.yaml | 9 --- .../chainsaw-step-01-assert-1-1.yaml | 9 --- .../mutate-existing/chainsaw-test.yaml | 22 +++++-- ...hainsaw-step-01-apply-1-1.yaml => ns.yaml} | 0 ...saw-step-01-apply-1-3.yaml => policy.yaml} | 0 ...saw-step-01-apply-1-2.yaml => secret.yaml} | 0 .../report-deletion/chainsaw-test.yaml | 20 +++++-- .../report-deletion/policy-assert.yaml | 9 --- .../chainsaw-test.yaml | 20 +++++-- .../policy-assert.yaml | 23 ------- .../chainsaw-test.yaml | 52 +++++++++------- .../policy-assert.yaml | 9 --- .../verify-image-fail/chainsaw-test.yaml | 20 +++++-- .../verify-image-fail/policy-assert.yaml | 9 --- .../verify-image-pass/chainsaw-test.yaml | 20 +++++-- .../verify-image-pass/policy-assert.yaml | 9 --- 52 files changed, 347 insertions(+), 378 deletions(-) delete mode 100644 test/conformance/chainsaw/reports/admission/exception/policy-assert.yaml delete mode 100755 test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-assert-1-1.yaml rename test/conformance/chainsaw/reports/admission/mutation/{chainsaw-step-01-apply-1-1.yaml => policy.yaml} (100%) delete mode 100644 test/conformance/chainsaw/reports/admission/namespaceselector-assert/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/admission/namespaceselector/policy-assert.yaml delete mode 100755 test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-assert-1.yaml rename test/conformance/chainsaw/reports/admission/test-report-admission-mode/{chainsaw-step-01-apply-1.yaml => policy.yaml} (100%) delete mode 100755 test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-assert-1.yaml rename test/conformance/chainsaw/reports/admission/test-report-audit-warn/{chainsaw-step-01-apply-1.yaml => policy.yaml} (100%) delete mode 100755 test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-assert-1.yaml rename test/conformance/chainsaw/reports/admission/test-report-properties/{chainsaw-step-01-apply-1.yaml => policy.yaml} (100%) delete mode 100644 test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/admission/update-deployment/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/admission/update/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/exception-assert/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/exception-with-conditions/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/exception-with-podsecurity/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/exception/policy-assert.yaml delete mode 100755 test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-assert-1-1.yaml rename test/conformance/chainsaw/reports/background/generate/{chainsaw-step-01-apply-1-1.yaml => policy.yaml} (100%) delete mode 100644 test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/policy-assert.yaml delete mode 100755 test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-assert-1-1.yaml rename test/conformance/chainsaw/reports/background/mutate-existing/{chainsaw-step-01-apply-1-1.yaml => ns.yaml} (100%) rename test/conformance/chainsaw/reports/background/mutate-existing/{chainsaw-step-01-apply-1-3.yaml => policy.yaml} (100%) rename test/conformance/chainsaw/reports/background/mutate-existing/{chainsaw-step-01-apply-1-2.yaml => secret.yaml} (100%) delete mode 100644 test/conformance/chainsaw/reports/background/report-deletion/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/test-report-background-mode/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/two-rules-with-different-modes/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/verify-image-fail/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/reports/background/verify-image-pass/policy-assert.yaml diff --git a/test/conformance/chainsaw/reports/admission/exception/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/exception/chainsaw-test.yaml index 8f9b14a65b..6c91dd4005 100755 --- a/test/conformance/chainsaw/reports/admission/exception/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/exception/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: exception spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/exception/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/exception/policy-assert.yaml deleted file mode 100644 index b0bd73c54e..0000000000 --- a/test/conformance/chainsaw/reports/admission/exception/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-assert-1-1.yaml b/test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-assert-1-1.yaml deleted file mode 100755 index 7e9f14965b..0000000000 --- a/test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-assert-1-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: add-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/mutation/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/mutation/chainsaw-test.yaml index 66251ae75f..7cafcedcd6 100755 --- a/test/conformance/chainsaw/reports/admission/mutation/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/mutation/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: basic-check-output spec: steps: - - name: step-01 - try: - - apply: - file: chainsaw-step-01-apply-1-1.yaml - - assert: - file: chainsaw-step-01-assert-1-1.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-apply-1-1.yaml b/test/conformance/chainsaw/reports/admission/mutation/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/admission/mutation/chainsaw-step-01-apply-1-1.yaml rename to test/conformance/chainsaw/reports/admission/mutation/policy.yaml diff --git a/test/conformance/chainsaw/reports/admission/namespaceselector-assert/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/namespaceselector-assert/chainsaw-test.yaml index edb736ca19..f2cd72fa8f 100755 --- a/test/conformance/chainsaw/reports/admission/namespaceselector-assert/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/namespaceselector-assert/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: namespaceselector spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: test-audit-reports-namespacesselector - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/namespaceselector-assert/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/namespaceselector-assert/policy-assert.yaml deleted file mode 100644 index 203bc8ee93..0000000000 --- a/test/conformance/chainsaw/reports/admission/namespaceselector-assert/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: test-audit-reports-namespacesselector -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/namespaceselector/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/namespaceselector/chainsaw-test.yaml index edb736ca19..f2cd72fa8f 100755 --- a/test/conformance/chainsaw/reports/admission/namespaceselector/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/namespaceselector/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: namespaceselector spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: test-audit-reports-namespacesselector - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/namespaceselector/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/namespaceselector/policy-assert.yaml deleted file mode 100644 index 203bc8ee93..0000000000 --- a/test/conformance/chainsaw/reports/admission/namespaceselector/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: test-audit-reports-namespacesselector -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-assert-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-assert-1.yaml deleted file mode 100755 index d3fab0a660..0000000000 --- a/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-assert-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-owner -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-test.yaml index df4729df69..0940ccbcc0 100755 --- a/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: test-report-admission-mode spec: steps: - - name: step-01 - try: - - apply: - file: chainsaw-step-01-apply-1.yaml - - assert: - file: chainsaw-step-01-assert-1.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: require-owner - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-apply-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-admission-mode/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/admission/test-report-admission-mode/chainsaw-step-01-apply-1.yaml rename to test/conformance/chainsaw/reports/admission/test-report-admission-mode/policy.yaml diff --git a/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-assert-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-assert-1.yaml deleted file mode 100755 index 07f53aa62e..0000000000 --- a/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-assert-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-owner -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready \ No newline at end of file diff --git a/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-test.yaml index 79b4cf28ae..db8f53fd59 100755 --- a/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: test-report-audit-warn spec: steps: - - name: step-01 - try: - - apply: - file: chainsaw-step-01-apply-1.yaml - - assert: - file: chainsaw-step-01-assert-1.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: require-owner - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-apply-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-audit-warn/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/admission/test-report-audit-warn/chainsaw-step-01-apply-1.yaml rename to test/conformance/chainsaw/reports/admission/test-report-audit-warn/policy.yaml diff --git a/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-assert-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-assert-1.yaml deleted file mode 100755 index d3fab0a660..0000000000 --- a/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-assert-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-owner -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-test.yaml index df4729df69..0940ccbcc0 100755 --- a/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: test-report-admission-mode spec: steps: - - name: step-01 - try: - - apply: - file: chainsaw-step-01-apply-1.yaml - - assert: - file: chainsaw-step-01-assert-1.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: require-owner - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-apply-1.yaml b/test/conformance/chainsaw/reports/admission/test-report-properties/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/admission/test-report-properties/chainsaw-step-01-apply-1.yaml rename to test/conformance/chainsaw/reports/admission/test-report-properties/policy.yaml diff --git a/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/chainsaw-test.yaml index 3901e12933..79f615e62c 100644 --- a/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/chainsaw-test.yaml @@ -4,30 +4,38 @@ metadata: name: two-rules-with-different-modes spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml - - name: step-02 - try: + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: check-ns-labels + - name: step-02 + try: + - apply: + file: good-resources.yaml + - name: step-03 + try: - apply: - file: good-resources.yaml - - name: step-03 - try: - - apply: - expect: - - check: - ($error != null): true - file: bad-resources.yaml - - name: step-04 - try: - - sleep: - duration: 5s - - name: step-05 - try: - - assert: - file: reports-assert.yaml - - error: - file: reports-error.yaml + expect: + - check: + ($error != null): true + file: bad-resources.yaml + - name: step-04 + try: + - sleep: + duration: 5s + - name: step-05 + try: + - assert: + file: reports-assert.yaml + - error: + file: reports-error.yaml diff --git a/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/policy-assert.yaml deleted file mode 100644 index 3d14b530d7..0000000000 --- a/test/conformance/chainsaw/reports/admission/two-rules-with-different-modes/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: check-ns-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/update-deployment/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/update-deployment/chainsaw-test.yaml index f03b4bd360..e8d5fb32ec 100755 --- a/test/conformance/chainsaw/reports/admission/update-deployment/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/update-deployment/chainsaw-test.yaml @@ -5,12 +5,20 @@ metadata: name: update-deployment spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: require-multiple-replicas - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/update-deployment/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/update-deployment/policy-assert.yaml deleted file mode 100644 index 94bd911ff5..0000000000 --- a/test/conformance/chainsaw/reports/admission/update-deployment/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-multiple-replicas -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/admission/update/chainsaw-test.yaml b/test/conformance/chainsaw/reports/admission/update/chainsaw-test.yaml index fc6aeb415c..d7f0639293 100755 --- a/test/conformance/chainsaw/reports/admission/update/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/admission/update/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: update spec: steps: - - name: step-01 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: disallow-latest-tag - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/admission/update/policy-assert.yaml b/test/conformance/chainsaw/reports/admission/update/policy-assert.yaml deleted file mode 100644 index 19f4753128..0000000000 --- a/test/conformance/chainsaw/reports/admission/update/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: disallow-latest-tag -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/exception-assert/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/exception-assert/chainsaw-test.yaml index e64590fdd4..a1ebffee3d 100755 --- a/test/conformance/chainsaw/reports/background/exception-assert/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/exception-assert/chainsaw-test.yaml @@ -10,12 +10,20 @@ spec: file: configmap.yaml - assert: file: configmap.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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: step-03 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/exception-assert/policy-assert.yaml b/test/conformance/chainsaw/reports/background/exception-assert/policy-assert.yaml deleted file mode 100644 index b0bd73c54e..0000000000 --- a/test/conformance/chainsaw/reports/background/exception-assert/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/exception-with-conditions/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/exception-with-conditions/chainsaw-test.yaml index 9d5fc5b921..1fd37bcd78 100755 --- a/test/conformance/chainsaw/reports/background/exception-with-conditions/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/exception-with-conditions/chainsaw-test.yaml @@ -14,12 +14,20 @@ spec: try: - apply: file: deployment.yaml - - name: step-03 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: check-deployment-replicas - name: step-04 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/exception-with-conditions/policy-assert.yaml b/test/conformance/chainsaw/reports/background/exception-with-conditions/policy-assert.yaml deleted file mode 100644 index 792d2a7e1f..0000000000 --- a/test/conformance/chainsaw/reports/background/exception-with-conditions/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: check-deployment-replicas -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/exception-with-podsecurity/chainsaw-test.yaml index ee6038de3f..d58ca7b708 100755 --- a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/exception-with-podsecurity/chainsaw-test.yaml @@ -8,12 +8,20 @@ spec: try: - apply: file: pod.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: psa-1 - name: step-03 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/policy-assert.yaml b/test/conformance/chainsaw/reports/background/exception-with-podsecurity/policy-assert.yaml deleted file mode 100644 index d52b6efde4..0000000000 --- a/test/conformance/chainsaw/reports/background/exception-with-podsecurity/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: psa-1 -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/exception/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/exception/chainsaw-test.yaml index e64590fdd4..a1ebffee3d 100755 --- a/test/conformance/chainsaw/reports/background/exception/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/exception/chainsaw-test.yaml @@ -10,12 +10,20 @@ spec: file: configmap.yaml - assert: file: configmap.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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: step-03 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/exception/policy-assert.yaml b/test/conformance/chainsaw/reports/background/exception/policy-assert.yaml deleted file mode 100644 index b0bd73c54e..0000000000 --- a/test/conformance/chainsaw/reports/background/exception/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-assert-1-1.yaml b/test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-assert-1-1.yaml deleted file mode 100755 index bb748c5b1f..0000000000 --- a/test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-assert-1-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v2beta1 -kind: ClusterPolicy -metadata: - name: cpol-nosync-clone -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/generate/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/generate/chainsaw-test.yaml index d540ed0b25..f41b853bbb 100755 --- a/test/conformance/chainsaw/reports/background/generate/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/generate/chainsaw-test.yaml @@ -8,12 +8,23 @@ spec: try: - apply: file: permissions.yaml - - apply: - file: chainsaw-step-01-apply-1-1.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - try: - apply: file: chainsaw-step-01-apply-1-2.yaml - - assert: - file: chainsaw-step-01-assert-1-1.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: cpol-nosync-clone - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-apply-1-1.yaml b/test/conformance/chainsaw/reports/background/generate/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/background/generate/chainsaw-step-01-apply-1-1.yaml rename to test/conformance/chainsaw/reports/background/generate/policy.yaml diff --git a/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/chainsaw-test.yaml index 1df3121f59..d6c457374c 100755 --- a/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/chainsaw-test.yaml @@ -8,12 +8,20 @@ spec: try: - apply: file: pod.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: psp-baseline - name: step-03 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/policy-assert.yaml b/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/policy-assert.yaml deleted file mode 100644 index 21bb1a0623..0000000000 --- a/test/conformance/chainsaw/reports/background/multiple-exceptions-with-pod-security/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: psp-baseline -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-assert-1-1.yaml b/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-assert-1-1.yaml deleted file mode 100755 index 450edc769b..0000000000 --- a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-assert-1-1.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: mutate-existing-secret -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-test.yaml index 80b571cf07..c75550108c 100755 --- a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-test.yaml @@ -7,13 +7,23 @@ spec: - name: step-01 try: - apply: - file: chainsaw-step-01-apply-1-1.yaml + file: ns.yaml - apply: - file: chainsaw-step-01-apply-1-2.yaml - - apply: - file: chainsaw-step-01-apply-1-3.yaml - - assert: - file: chainsaw-step-01-assert-1-1.yaml + file: secret.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: mutate-existing-secret - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-1.yaml b/test/conformance/chainsaw/reports/background/mutate-existing/ns.yaml similarity index 100% rename from test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-1.yaml rename to test/conformance/chainsaw/reports/background/mutate-existing/ns.yaml diff --git a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-3.yaml b/test/conformance/chainsaw/reports/background/mutate-existing/policy.yaml similarity index 100% rename from test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-3.yaml rename to test/conformance/chainsaw/reports/background/mutate-existing/policy.yaml diff --git a/test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-2.yaml b/test/conformance/chainsaw/reports/background/mutate-existing/secret.yaml similarity index 100% rename from test/conformance/chainsaw/reports/background/mutate-existing/chainsaw-step-01-apply-1-2.yaml rename to test/conformance/chainsaw/reports/background/mutate-existing/secret.yaml diff --git a/test/conformance/chainsaw/reports/background/report-deletion/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/report-deletion/chainsaw-test.yaml index 5323598658..4794f953b2 100755 --- a/test/conformance/chainsaw/reports/background/report-deletion/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/report-deletion/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: report-deletion spec: steps: - - name: step-00 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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-01 try: - apply: diff --git a/test/conformance/chainsaw/reports/background/report-deletion/policy-assert.yaml b/test/conformance/chainsaw/reports/background/report-deletion/policy-assert.yaml deleted file mode 100644 index c21f7dd310..0000000000 --- a/test/conformance/chainsaw/reports/background/report-deletion/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: podsecurity-subrule-restricted -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/test-report-background-mode/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/test-report-background-mode/chainsaw-test.yaml index fa3ea41c03..b78e855f3e 100755 --- a/test/conformance/chainsaw/reports/background/test-report-background-mode/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/test-report-background-mode/chainsaw-test.yaml @@ -10,12 +10,20 @@ spec: file: pod.yaml - assert: file: pod-assert.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - 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-03 try: - assert: diff --git a/test/conformance/chainsaw/reports/background/test-report-background-mode/policy-assert.yaml b/test/conformance/chainsaw/reports/background/test-report-background-mode/policy-assert.yaml deleted file mode 100644 index 22ee875dec..0000000000 --- a/test/conformance/chainsaw/reports/background/test-report-background-mode/policy-assert.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: podsecurity-subrule-restricted -spec: - background: true - rules: - - match: - any: - - resources: - kinds: - - Pod - name: restricted - validate: - failureAction: Audit - podSecurity: - level: restricted - version: latest -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/chainsaw-test.yaml index 45990c48ce..fcf40a4039 100644 --- a/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/chainsaw-test.yaml @@ -4,25 +4,33 @@ metadata: name: two-rules-with-different-modes spec: steps: - - name: step-01 - try: - - apply: - file: good-resources.yaml - - name: step-02 - try: - - apply: - file: bad-resources.yaml - - name: step-03 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml - - name: step-04 - try: - - sleep: - duration: 10s - - name: step-05 - try: - - assert: - file: reports-assert.yaml + - name: step-01 + try: + - apply: + file: good-resources.yaml + - name: step-02 + try: + - apply: + file: bad-resources.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: check-ns-labels + - name: step-04 + try: + - sleep: + duration: 10s + - name: step-05 + try: + - assert: + file: reports-assert.yaml diff --git a/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/policy-assert.yaml b/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/policy-assert.yaml deleted file mode 100644 index 3d14b530d7..0000000000 --- a/test/conformance/chainsaw/reports/background/two-rules-with-different-modes/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: check-ns-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/verify-image-fail/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/verify-image-fail/chainsaw-test.yaml index 8e6df45de3..ae2ce389f3 100755 --- a/test/conformance/chainsaw/reports/background/verify-image-fail/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/verify-image-fail/chainsaw-test.yaml @@ -10,12 +10,20 @@ spec: file: pod.yaml - assert: file: pod-assert.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/policy-ready.yaml + with: + bindings: + - name: name + value: keyed-basic-policy - name: step-03 try: - assert: diff --git a/test/conformance/chainsaw/reports/background/verify-image-fail/policy-assert.yaml b/test/conformance/chainsaw/reports/background/verify-image-fail/policy-assert.yaml deleted file mode 100644 index 9b7835826a..0000000000 --- a/test/conformance/chainsaw/reports/background/verify-image-fail/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: keyed-basic-policy -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/reports/background/verify-image-pass/chainsaw-test.yaml b/test/conformance/chainsaw/reports/background/verify-image-pass/chainsaw-test.yaml index cf0a3a1e8c..3722fa5377 100755 --- a/test/conformance/chainsaw/reports/background/verify-image-pass/chainsaw-test.yaml +++ b/test/conformance/chainsaw/reports/background/verify-image-pass/chainsaw-test.yaml @@ -10,12 +10,20 @@ spec: file: pod.yaml - assert: file: pod-assert.yaml - - name: step-02 - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml + - name: create policy + use: + template: ../../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: policy.yaml + - name: wait policy ready + use: + template: ../../../_step-templates/policy-ready.yaml + with: + bindings: + - name: name + value: keyed-basic-policy - name: step-03 try: - assert: diff --git a/test/conformance/chainsaw/reports/background/verify-image-pass/policy-assert.yaml b/test/conformance/chainsaw/reports/background/verify-image-pass/policy-assert.yaml deleted file mode 100644 index 9b7835826a..0000000000 --- a/test/conformance/chainsaw/reports/background/verify-image-pass/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: keyed-basic-policy -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready