From 6870d8fdf8df0737f3434b190473bffc5854ac96 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 10:36:30 +0200 Subject: [PATCH] chore: use more chainsaw step templates (#11300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- .../basic-deprecated/chainsaw-test.yaml | 18 +++++++++++---- .../basic-deprecated/policy-assert.yaml | 9 -------- .../standard/basic/chainsaw-test.yaml | 18 +++++++++++---- .../standard/basic/policy-assert.yaml | 9 -------- .../chainsaw-test.yaml | 20 ++++++++++++---- .../dependencies-deprecated/deploy.yaml | 2 -- .../deferred/dependencies-deprecated/ns.yaml | 4 ++++ .../policy-assert.yaml | 9 -------- .../{manifests.yaml => policy.yaml} | 6 ----- .../deferred/dependencies/chainsaw-test.yaml | 20 ++++++++++++---- .../deferred/dependencies/deploy.yaml | 2 -- .../chainsaw/deferred/dependencies/ns.yaml | 4 ++++ .../deferred/dependencies/policy-assert.yaml | 9 -------- .../{manifests.yaml => policy.yaml} | 6 ----- .../deferred/foreach/chainsaw-test.yaml | 20 +++++++++++----- .../deferred/foreach/policy-assert.yaml | 9 -------- .../foreach/{manifests.yaml => policy.yaml} | 1 - .../deferred/recursive/chainsaw-test.yaml | 20 +++++++++++----- .../deferred/recursive/policy-assert.yaml | 9 -------- .../chainsaw-test.yaml | 20 +++++++++++----- .../policy-assert.yaml | 9 -------- .../deferred/two-rules/chainsaw-test.yaml | 20 +++++++++++----- .../deferred/two-rules/policy-assert.yaml | 9 -------- .../exclude/sa/no-wildcard/chainsaw-test.yaml | 20 +++++++++++----- .../exclude/sa/no-wildcard/policy-assert.yaml | 10 -------- .../exclude/sa/wildcard/chainsaw-test.yaml | 20 +++++++++++----- .../exclude/sa/wildcard/policy-assert.yaml | 10 -------- .../user/no-wildcard/block/chainsaw-test.yaml | 20 +++++++++++----- .../user/no-wildcard/block/policy-assert.yaml | 10 -------- .../user/no-wildcard/pass/chainsaw-test.yaml | 20 +++++++++++----- .../user/no-wildcard/pass/policy-assert.yaml | 10 -------- .../user/wildcard/block/chainsaw-test.yaml | 20 +++++++++++----- .../user/wildcard/block/policy-assert.yaml | 10 -------- .../user/wildcard/pass/chainsaw-test.yaml | 20 +++++++++++----- .../user/wildcard/pass/policy-assert.yaml | 10 -------- .../match/sa/no-wildcard/chainsaw-test.yaml | 20 +++++++++++----- .../match/sa/no-wildcard/policy-assert.yaml | 10 -------- .../match/sa/wildcard/chainsaw-test.yaml | 20 +++++++++++----- .../match/sa/wildcard/policy-assert.yaml | 10 -------- .../user/no-wildcard/block/chainsaw-test.yaml | 20 +++++++++++----- .../user/no-wildcard/block/policy-assert.yaml | 10 -------- .../user/no-wildcard/pass/chainsaw-test.yaml | 20 +++++++++++----- .../user/no-wildcard/pass/policy-assert.yaml | 10 -------- .../user/wildcard/block/chainsaw-test.yaml | 20 +++++++++++----- .../user/wildcard/block/policy-assert.yaml | 10 -------- .../user/wildcard/pass/chainsaw-test.yaml | 20 +++++++++++----- .../user/wildcard/pass/policy-assert.yaml | 10 -------- .../apicall-correct/chainsaw-test.yaml | 22 +++++++++++++----- .../apicall-correct/clusterpolicy-ready.yaml | 9 -------- .../{clusterpolicy.yaml => policy.yaml} | 0 .../not-ready/chainsaw-test.yaml | 23 +++++++++++++------ .../not-ready/clusterpolicy-ready.yaml | 9 -------- ...rpolicy-failed.yaml => policy-failed.yaml} | 0 .../{clusterpolicy.yaml => policy.yaml} | 0 .../resource-correct/chainsaw-test.yaml | 23 +++++++++++++------ .../resource-correct/clusterpolicy-ready.yaml | 9 -------- .../{clusterpolicy.yaml => policy.yaml} | 0 .../chainsaw-test.yaml | 20 +++++++++++----- .../policy-assert.yaml | 9 -------- .../chainsaw-test.yaml | 20 +++++++++++----- .../policy-assert.yaml | 9 -------- .../schema-validation-crd/chainsaw-test.yaml | 18 +++++++++++---- .../schema-validation-crd/policy-assert.yaml | 9 -------- ...insaw-step-01-apply-1.yaml => policy.yaml} | 0 .../cluster-policy/success/chainsaw-test.yaml | 20 +++++++++++----- .../success/policy-1-assert.yaml | 9 -------- .../success/{policy-1.yaml => policy.yaml} | 0 67 files changed, 396 insertions(+), 426 deletions(-) delete mode 100644 test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/custom-sigstore/standard/basic/policy-assert.yaml create mode 100644 test/conformance/chainsaw/deferred/dependencies-deprecated/ns.yaml delete mode 100644 test/conformance/chainsaw/deferred/dependencies-deprecated/policy-assert.yaml rename test/conformance/chainsaw/deferred/dependencies-deprecated/{manifests.yaml => policy.yaml} (97%) create mode 100644 test/conformance/chainsaw/deferred/dependencies/ns.yaml delete mode 100644 test/conformance/chainsaw/deferred/dependencies/policy-assert.yaml rename test/conformance/chainsaw/deferred/dependencies/{manifests.yaml => policy.yaml} (97%) delete mode 100644 test/conformance/chainsaw/deferred/foreach/policy-assert.yaml rename test/conformance/chainsaw/deferred/foreach/{manifests.yaml => policy.yaml} (99%) delete mode 100644 test/conformance/chainsaw/deferred/recursive/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/deferred/resolve-overriden-variable/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/deferred/two-rules/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/sa/no-wildcard/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/sa/wildcard/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/user/wildcard/block/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/exclude/user/wildcard/pass/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/sa/no-wildcard/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/sa/wildcard/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/user/no-wildcard/block/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/user/no-wildcard/pass/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/user/wildcard/block/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/filter/match/user/wildcard/pass/policy-assert.yaml delete mode 100755 test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy-ready.yaml rename test/conformance/chainsaw/globalcontext/apicall-correct/{clusterpolicy.yaml => policy.yaml} (100%) delete mode 100755 test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-ready.yaml rename test/conformance/chainsaw/globalcontext/not-ready/{clusterpolicy-failed.yaml => policy-failed.yaml} (100%) rename test/conformance/chainsaw/globalcontext/not-ready/{clusterpolicy.yaml => policy.yaml} (100%) delete mode 100755 test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy-ready.yaml rename test/conformance/chainsaw/globalcontext/resource-correct/{clusterpolicy.yaml => policy.yaml} (100%) delete mode 100644 test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy-assert.yaml delete mode 100644 test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy-assert.yaml rename test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/{chainsaw-step-01-apply-1.yaml => policy.yaml} (100%) delete mode 100644 test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1-assert.yaml rename test/conformance/chainsaw/policy-validation/cluster-policy/success/{policy-1.yaml => policy.yaml} (100%) diff --git a/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/chainsaw-test.yaml index 1ad9aee701..e2e0b7cc7d 100644 --- a/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/chainsaw-test.yaml @@ -6,11 +6,21 @@ spec: concurrent: false namespace: foo steps: + - 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: basic-sigstore-test-policy - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml - script: content: kubectl run -n $NAMESPACE test-sigstore --image=$TEST_IMAGE_URL - assert: diff --git a/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/policy-assert.yaml b/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/policy-assert.yaml deleted file mode 100644 index d622499100..0000000000 --- a/test/conformance/chainsaw/custom-sigstore/standard/basic-deprecated/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: basic-sigstore-test-policy -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/custom-sigstore/standard/basic/chainsaw-test.yaml b/test/conformance/chainsaw/custom-sigstore/standard/basic/chainsaw-test.yaml index 1ad9aee701..e2e0b7cc7d 100644 --- a/test/conformance/chainsaw/custom-sigstore/standard/basic/chainsaw-test.yaml +++ b/test/conformance/chainsaw/custom-sigstore/standard/basic/chainsaw-test.yaml @@ -6,11 +6,21 @@ spec: concurrent: false namespace: foo steps: + - 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: basic-sigstore-test-policy - try: - - apply: - file: policy.yaml - - assert: - file: policy-assert.yaml - script: content: kubectl run -n $NAMESPACE test-sigstore --image=$TEST_IMAGE_URL - assert: diff --git a/test/conformance/chainsaw/custom-sigstore/standard/basic/policy-assert.yaml b/test/conformance/chainsaw/custom-sigstore/standard/basic/policy-assert.yaml deleted file mode 100644 index d622499100..0000000000 --- a/test/conformance/chainsaw/custom-sigstore/standard/basic/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: basic-sigstore-test-policy -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/dependencies-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/dependencies-deprecated/chainsaw-test.yaml index e037d47236..32c9291dd8 100755 --- a/test/conformance/chainsaw/deferred/dependencies-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/dependencies-deprecated/chainsaw-test.yaml @@ -4,12 +4,24 @@ metadata: name: dependencies spec: steps: - - name: step-01 + - name: create namespace try: - apply: - file: manifests.yaml - - assert: - file: policy-assert.yaml + file: ns.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: enforce-company-budget - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/dependencies-deprecated/deploy.yaml b/test/conformance/chainsaw/deferred/dependencies-deprecated/deploy.yaml index c03b8fa60f..419ab01a47 100644 --- a/test/conformance/chainsaw/deferred/dependencies-deprecated/deploy.yaml +++ b/test/conformance/chainsaw/deferred/dependencies-deprecated/deploy.yaml @@ -1,5 +1,3 @@ - ---- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/test/conformance/chainsaw/deferred/dependencies-deprecated/ns.yaml b/test/conformance/chainsaw/deferred/dependencies-deprecated/ns.yaml new file mode 100644 index 0000000000..776c3c00ba --- /dev/null +++ b/test/conformance/chainsaw/deferred/dependencies-deprecated/ns.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: acme-fitness diff --git a/test/conformance/chainsaw/deferred/dependencies-deprecated/policy-assert.yaml b/test/conformance/chainsaw/deferred/dependencies-deprecated/policy-assert.yaml deleted file mode 100644 index 8ce29958ed..0000000000 --- a/test/conformance/chainsaw/deferred/dependencies-deprecated/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: enforce-company-budget -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/dependencies-deprecated/manifests.yaml b/test/conformance/chainsaw/deferred/dependencies-deprecated/policy.yaml similarity index 97% rename from test/conformance/chainsaw/deferred/dependencies-deprecated/manifests.yaml rename to test/conformance/chainsaw/deferred/dependencies-deprecated/policy.yaml index ffdbf0a9af..a4fd3c002f 100644 --- a/test/conformance/chainsaw/deferred/dependencies-deprecated/manifests.yaml +++ b/test/conformance/chainsaw/deferred/dependencies-deprecated/policy.yaml @@ -1,9 +1,3 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - name: acme-fitness ---- apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: diff --git a/test/conformance/chainsaw/deferred/dependencies/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/dependencies/chainsaw-test.yaml index e037d47236..32c9291dd8 100755 --- a/test/conformance/chainsaw/deferred/dependencies/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/dependencies/chainsaw-test.yaml @@ -4,12 +4,24 @@ metadata: name: dependencies spec: steps: - - name: step-01 + - name: create namespace try: - apply: - file: manifests.yaml - - assert: - file: policy-assert.yaml + file: ns.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: enforce-company-budget - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/dependencies/deploy.yaml b/test/conformance/chainsaw/deferred/dependencies/deploy.yaml index c03b8fa60f..419ab01a47 100644 --- a/test/conformance/chainsaw/deferred/dependencies/deploy.yaml +++ b/test/conformance/chainsaw/deferred/dependencies/deploy.yaml @@ -1,5 +1,3 @@ - ---- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/test/conformance/chainsaw/deferred/dependencies/ns.yaml b/test/conformance/chainsaw/deferred/dependencies/ns.yaml new file mode 100644 index 0000000000..776c3c00ba --- /dev/null +++ b/test/conformance/chainsaw/deferred/dependencies/ns.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: acme-fitness diff --git a/test/conformance/chainsaw/deferred/dependencies/policy-assert.yaml b/test/conformance/chainsaw/deferred/dependencies/policy-assert.yaml deleted file mode 100644 index 8ce29958ed..0000000000 --- a/test/conformance/chainsaw/deferred/dependencies/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: enforce-company-budget -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/dependencies/manifests.yaml b/test/conformance/chainsaw/deferred/dependencies/policy.yaml similarity index 97% rename from test/conformance/chainsaw/deferred/dependencies/manifests.yaml rename to test/conformance/chainsaw/deferred/dependencies/policy.yaml index cda1903206..5ce8b49e4e 100644 --- a/test/conformance/chainsaw/deferred/dependencies/manifests.yaml +++ b/test/conformance/chainsaw/deferred/dependencies/policy.yaml @@ -1,9 +1,3 @@ ---- -apiVersion: v1 -kind: Namespace -metadata: - name: acme-fitness ---- apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: diff --git a/test/conformance/chainsaw/deferred/foreach/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/foreach/chainsaw-test.yaml index 803f989596..fac10c8284 100755 --- a/test/conformance/chainsaw/deferred/foreach/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/foreach/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: foreach spec: steps: - - name: step-01 - try: - - apply: - file: manifests.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: testcase-7fki3 - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/foreach/policy-assert.yaml b/test/conformance/chainsaw/deferred/foreach/policy-assert.yaml deleted file mode 100644 index d83273fb9e..0000000000 --- a/test/conformance/chainsaw/deferred/foreach/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: testcase-7fki3 -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/foreach/manifests.yaml b/test/conformance/chainsaw/deferred/foreach/policy.yaml similarity index 99% rename from test/conformance/chainsaw/deferred/foreach/manifests.yaml rename to test/conformance/chainsaw/deferred/foreach/policy.yaml index cae265a4e0..f2a862e3aa 100644 --- a/test/conformance/chainsaw/deferred/foreach/manifests.yaml +++ b/test/conformance/chainsaw/deferred/foreach/policy.yaml @@ -1,4 +1,3 @@ ---- apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: diff --git a/test/conformance/chainsaw/deferred/recursive/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/recursive/chainsaw-test.yaml index 4d5085e2c8..5206c61b79 100755 --- a/test/conformance/chainsaw/deferred/recursive/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/recursive/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: recursive 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: one - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/recursive/policy-assert.yaml b/test/conformance/chainsaw/deferred/recursive/policy-assert.yaml deleted file mode 100644 index 6277d9899f..0000000000 --- a/test/conformance/chainsaw/deferred/recursive/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: one -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/resolve-overriden-variable/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/resolve-overriden-variable/chainsaw-test.yaml index 0d17882d48..2071173b68 100755 --- a/test/conformance/chainsaw/deferred/resolve-overriden-variable/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/resolve-overriden-variable/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: resolve-overriden-variable 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: one - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/resolve-overriden-variable/policy-assert.yaml b/test/conformance/chainsaw/deferred/resolve-overriden-variable/policy-assert.yaml deleted file mode 100644 index 6277d9899f..0000000000 --- a/test/conformance/chainsaw/deferred/resolve-overriden-variable/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: one -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/deferred/two-rules/chainsaw-test.yaml b/test/conformance/chainsaw/deferred/two-rules/chainsaw-test.yaml index f263b448aa..fd8874c1d3 100755 --- a/test/conformance/chainsaw/deferred/two-rules/chainsaw-test.yaml +++ b/test/conformance/chainsaw/deferred/two-rules/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: two-rules 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: one - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/deferred/two-rules/policy-assert.yaml b/test/conformance/chainsaw/deferred/two-rules/policy-assert.yaml deleted file mode 100644 index 6277d9899f..0000000000 --- a/test/conformance/chainsaw/deferred/two-rules/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: one -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/chainsaw-test.yaml index 34d80f935f..e4936d6fcb 100755 --- a/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-wildcard 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/sa/no-wildcard/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/sa/wildcard/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/sa/wildcard/chainsaw-test.yaml index 0a56b44168..f157970de5 100755 --- a/test/conformance/chainsaw/filter/exclude/sa/wildcard/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/sa/wildcard/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: wildcard 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/sa/wildcard/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/sa/wildcard/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/sa/wildcard/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/chainsaw-test.yaml index 8ec12dfc25..785d4c7e3a 100755 --- a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: block 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/block/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/chainsaw-test.yaml index 95a0b3d5cb..e55fc40283 100755 --- a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pass 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/user/no-wildcard/pass/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/user/wildcard/block/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/user/wildcard/block/chainsaw-test.yaml index 8ec12dfc25..785d4c7e3a 100755 --- a/test/conformance/chainsaw/filter/exclude/user/wildcard/block/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/user/wildcard/block/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: block 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/user/wildcard/block/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/user/wildcard/block/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/user/wildcard/block/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/chainsaw-test.yaml b/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/chainsaw-test.yaml index 95a0b3d5cb..e55fc40283 100755 --- a/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pass 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/policy-assert.yaml b/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/exclude/user/wildcard/pass/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/sa/no-wildcard/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/sa/no-wildcard/chainsaw-test.yaml index 3881d473d6..75fcd1d956 100755 --- a/test/conformance/chainsaw/filter/match/sa/no-wildcard/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/sa/no-wildcard/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-wildcard 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/sa/no-wildcard/policy-assert.yaml b/test/conformance/chainsaw/filter/match/sa/no-wildcard/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/sa/no-wildcard/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/sa/wildcard/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/sa/wildcard/chainsaw-test.yaml index b7c380586e..858becb61a 100755 --- a/test/conformance/chainsaw/filter/match/sa/wildcard/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/sa/wildcard/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: wildcard 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/sa/wildcard/policy-assert.yaml b/test/conformance/chainsaw/filter/match/sa/wildcard/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/sa/wildcard/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/user/no-wildcard/block/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/user/no-wildcard/block/chainsaw-test.yaml index 8ec12dfc25..785d4c7e3a 100755 --- a/test/conformance/chainsaw/filter/match/user/no-wildcard/block/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/user/no-wildcard/block/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: block 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/user/no-wildcard/block/policy-assert.yaml b/test/conformance/chainsaw/filter/match/user/no-wildcard/block/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/user/no-wildcard/block/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/chainsaw-test.yaml index 95a0b3d5cb..e55fc40283 100755 --- a/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pass 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/policy-assert.yaml b/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/user/no-wildcard/pass/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/user/wildcard/block/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/user/wildcard/block/chainsaw-test.yaml index 8ec12dfc25..785d4c7e3a 100755 --- a/test/conformance/chainsaw/filter/match/user/wildcard/block/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/user/wildcard/block/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: block 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/user/wildcard/block/policy-assert.yaml b/test/conformance/chainsaw/filter/match/user/wildcard/block/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/user/wildcard/block/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/filter/match/user/wildcard/pass/chainsaw-test.yaml b/test/conformance/chainsaw/filter/match/user/wildcard/pass/chainsaw-test.yaml index 95a0b3d5cb..e55fc40283 100755 --- a/test/conformance/chainsaw/filter/match/user/wildcard/pass/chainsaw-test.yaml +++ b/test/conformance/chainsaw/filter/match/user/wildcard/pass/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pass 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: block-pod - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/filter/match/user/wildcard/pass/policy-assert.yaml b/test/conformance/chainsaw/filter/match/user/wildcard/pass/policy-assert.yaml deleted file mode 100644 index a7c862fb2b..0000000000 --- a/test/conformance/chainsaw/filter/match/user/wildcard/pass/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: block-pod -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/globalcontext/apicall-correct/chainsaw-test.yaml b/test/conformance/chainsaw/globalcontext/apicall-correct/chainsaw-test.yaml index 514df451eb..09247fc29f 100755 --- a/test/conformance/chainsaw/globalcontext/apicall-correct/chainsaw-test.yaml +++ b/test/conformance/chainsaw/globalcontext/apicall-correct/chainsaw-test.yaml @@ -4,8 +4,7 @@ metadata: name: apicall-correct spec: steps: - - name: scenario - try: + - try: - apply: file: namespace.yaml - apply: @@ -14,12 +13,23 @@ spec: file: gctxentry.yaml - sleep: duration: 3s - - apply: - file: clusterpolicy.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: cpol-apicall-correct + - try: - sleep: duration: 3s - - assert: - file: clusterpolicy-ready.yaml - apply: file: new-deployment.yaml - assert: diff --git a/test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy-ready.yaml b/test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy-ready.yaml deleted file mode 100755 index d456c1b81c..0000000000 --- a/test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy-ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: cpol-apicall-correct -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy.yaml b/test/conformance/chainsaw/globalcontext/apicall-correct/policy.yaml similarity index 100% rename from test/conformance/chainsaw/globalcontext/apicall-correct/clusterpolicy.yaml rename to test/conformance/chainsaw/globalcontext/apicall-correct/policy.yaml diff --git a/test/conformance/chainsaw/globalcontext/not-ready/chainsaw-test.yaml b/test/conformance/chainsaw/globalcontext/not-ready/chainsaw-test.yaml index 28a10d71e3..902bc847af 100755 --- a/test/conformance/chainsaw/globalcontext/not-ready/chainsaw-test.yaml +++ b/test/conformance/chainsaw/globalcontext/not-ready/chainsaw-test.yaml @@ -14,12 +14,21 @@ spec: file: gctxentry.yaml - sleep: duration: 3s - - apply: - file: clusterpolicy.yaml - - sleep: - duration: 3s - - assert: - file: clusterpolicy-ready.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: cpol-not-ready + - try: - delete: ref: apiVersion: kyverno.io/v2alpha1 @@ -28,7 +37,7 @@ spec: - sleep: duration: 3s - assert: - file: clusterpolicy-failed.yaml + file: policy-failed.yaml - apply: file: new-deployment.yaml - assert: diff --git a/test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-ready.yaml b/test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-ready.yaml deleted file mode 100755 index ce59fdcea4..0000000000 --- a/test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: cpol-not-ready -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-failed.yaml b/test/conformance/chainsaw/globalcontext/not-ready/policy-failed.yaml similarity index 100% rename from test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy-failed.yaml rename to test/conformance/chainsaw/globalcontext/not-ready/policy-failed.yaml diff --git a/test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy.yaml b/test/conformance/chainsaw/globalcontext/not-ready/policy.yaml similarity index 100% rename from test/conformance/chainsaw/globalcontext/not-ready/clusterpolicy.yaml rename to test/conformance/chainsaw/globalcontext/not-ready/policy.yaml diff --git a/test/conformance/chainsaw/globalcontext/resource-correct/chainsaw-test.yaml b/test/conformance/chainsaw/globalcontext/resource-correct/chainsaw-test.yaml index 745b1f937c..c2805dec0c 100755 --- a/test/conformance/chainsaw/globalcontext/resource-correct/chainsaw-test.yaml +++ b/test/conformance/chainsaw/globalcontext/resource-correct/chainsaw-test.yaml @@ -1,7 +1,7 @@ apiVersion: chainsaw.kyverno.io/v1alpha1 kind: Test metadata: - name: resource-correct + name: cpol-resource-correct spec: steps: - name: scenario @@ -14,12 +14,21 @@ spec: file: gctxentry.yaml - sleep: duration: 3s - - apply: - file: clusterpolicy.yaml - - sleep: - duration: 3s - - assert: - file: clusterpolicy-ready.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: cpol-resource-correct + - try: - apply: file: new-deployment.yaml - assert: diff --git a/test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy-ready.yaml b/test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy-ready.yaml deleted file mode 100755 index 941491ba9c..0000000000 --- a/test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy-ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: cpol-resource-correct -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy.yaml b/test/conformance/chainsaw/globalcontext/resource-correct/policy.yaml similarity index 100% rename from test/conformance/chainsaw/globalcontext/resource-correct/clusterpolicy.yaml rename to test/conformance/chainsaw/globalcontext/resource-correct/policy.yaml diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/chainsaw-test.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/chainsaw-test.yaml index c6910f3e77..cae67aae5b 100755 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/chainsaw-test.yaml +++ b/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: background-variables-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: background-variables-update - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/policy-assert.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/policy-assert.yaml deleted file mode 100644 index 277982879c..0000000000 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/background-variables-update/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: background-variables-update -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready \ No newline at end of file diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/chainsaw-test.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/chainsaw-test.yaml index 532ae10750..0cc3bdb956 100755 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/chainsaw-test.yaml +++ b/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: policy-exceptions-disabled 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: require-app-label - name: step-01 try: - apply: diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy-assert.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy-assert.yaml deleted file mode 100644 index 996222eb02..0000000000 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/policy-exceptions-disabled/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: require-app-label -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready \ No newline at end of file diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-test.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-test.yaml index b61bee7f3f..0376f264a6 100755 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-test.yaml +++ b/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-test.yaml @@ -4,7 +4,17 @@ metadata: name: schema-validation-crd spec: steps: - - name: step-01 - try: - - apply: - file: chainsaw-step-01-apply-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: mutate-xteam-namespace-scoped-crds diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy-assert.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy-assert.yaml deleted file mode 100644 index 45ad7ff3a7..0000000000 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: mutate-xteam-namespace-scoped-crds -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready \ No newline at end of file diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-step-01-apply-1.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy.yaml similarity index 100% rename from test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/chainsaw-step-01-apply-1.yaml rename to test/conformance/chainsaw/policy-validation/cluster-policy/schema-validation-crd/policy.yaml diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/success/chainsaw-test.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/success/chainsaw-test.yaml index 3683834e8d..db819fb39d 100755 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/success/chainsaw-test.yaml +++ b/test/conformance/chainsaw/policy-validation/cluster-policy/success/chainsaw-test.yaml @@ -4,9 +4,17 @@ metadata: name: success spec: steps: - - name: step-01 - try: - - apply: - file: policy-1.yaml - - assert: - file: policy-1-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: vault-init-injector diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1-assert.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1-assert.yaml deleted file mode 100644 index 689ed8e9dd..0000000000 --- a/test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: vault-init-injector -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1.yaml b/test/conformance/chainsaw/policy-validation/cluster-policy/success/policy.yaml similarity index 100% rename from test/conformance/chainsaw/policy-validation/cluster-policy/success/policy-1.yaml rename to test/conformance/chainsaw/policy-validation/cluster-policy/success/policy.yaml