diff --git a/test/conformance/chainsaw/_step-templates/policy-ready.yaml b/test/conformance/chainsaw/_step-templates/policy-ready.yaml new file mode 100644 index 0000000000..d17b20df3b --- /dev/null +++ b/test/conformance/chainsaw/_step-templates/policy-ready.yaml @@ -0,0 +1,19 @@ +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: StepTemplate +metadata: + name: policy-ready +spec: + try: + - assert: + template: true + resource: + apiVersion: kyverno.io/v1 + kind: Policy + metadata: + name: ($name) + namespace: ($namespace) + status: + conditions: + - reason: Succeeded + status: "True" + type: Ready diff --git a/test/conformance/chainsaw/assert/allow-existing-violations/chainsaw-test.yaml b/test/conformance/chainsaw/assert/allow-existing-violations/chainsaw-test.yaml index ee1a965be6..6cd7666f99 100755 --- a/test/conformance/chainsaw/assert/allow-existing-violations/chainsaw-test.yaml +++ b/test/conformance/chainsaw/assert/allow-existing-violations/chainsaw-test.yaml @@ -4,30 +4,38 @@ metadata: name: check-old-object spec: steps: - - name: step-01 - try: - - create: - file: ns.yaml - - assert: - file: ns-ready.yaml - - name: step-02 - try: - - create: - file: policy.yaml - - assert: - file: policy-ready.yaml - - name: step-03 - try: - - update: - file: ns-update.yaml - - name: step-04 - try: - - update: - file: ns-update-good.yaml - - name: step-05 - try: - - update: - file: ns-update-bad.yaml - expect: - - check: - ($error != null): true + - name: step-01 + try: + - create: + file: ns.yaml + - assert: + file: ns-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: check-old-object + - name: step-03 + try: + - update: + file: ns-update.yaml + - name: step-04 + try: + - update: + file: ns-update-good.yaml + - name: step-05 + try: + - update: + file: ns-update-bad.yaml + expect: + - check: + ($error != null): true diff --git a/test/conformance/chainsaw/assert/allow-existing-violations/policy-ready.yaml b/test/conformance/chainsaw/assert/allow-existing-violations/policy-ready.yaml deleted file mode 100644 index b8d67ef819..0000000000 --- a/test/conformance/chainsaw/assert/allow-existing-violations/policy-ready.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: check-old-object diff --git a/test/conformance/chainsaw/assert/old-object-exists/chainsaw-test.yaml b/test/conformance/chainsaw/assert/old-object-exists/chainsaw-test.yaml index 51a5a9f486..cdabfa072e 100755 --- a/test/conformance/chainsaw/assert/old-object-exists/chainsaw-test.yaml +++ b/test/conformance/chainsaw/assert/old-object-exists/chainsaw-test.yaml @@ -4,19 +4,27 @@ metadata: name: check-old-object spec: steps: - - name: step-01 - try: - - create: - file: policy.yaml - - assert: - file: policy-ready.yaml - - name: step-02 - try: - - create: - file: ns.yaml - - assert: - file: ns-ready.yaml - - name: step-03 - try: - - update: - file: ns-update.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-old-object + - name: step-02 + try: + - create: + file: ns.yaml + - assert: + file: ns-ready.yaml + - name: step-03 + try: + - update: + file: ns-update.yaml diff --git a/test/conformance/chainsaw/assert/old-object-exists/policy-ready.yaml b/test/conformance/chainsaw/assert/old-object-exists/policy-ready.yaml deleted file mode 100644 index b8d67ef819..0000000000 --- a/test/conformance/chainsaw/assert/old-object-exists/policy-ready.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: check-old-object diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/chainsaw-test.yaml index 0b32516743..1948ca08b2 100755 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-event 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml old mode 100755 new mode 100644 index 0b32516743..1948ca08b2 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-event 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-event/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/chainsaw-test.yaml index 86ae5fba48..02c22ff0e8 100755 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-report 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml index 86ae5fba48..02c22ff0e8 100755 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-report 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/no-admission-report/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/chainsaw-test.yaml index cc1979bf06..4943ca24be 100755 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: not-rejected 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml index cc1979bf06..4943ca24be 100755 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: not-rejected 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: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/policy-assert.yaml b/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/policy-assert.yaml deleted file mode 100644 index 4e2954e278..0000000000 --- a/test/conformance/chainsaw/background-only/cluster-policy/not-rejected/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/chainsaw-test.yaml index 0b32516743..748019818a 100755 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-event 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml index 0b32516743..748019818a 100755 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/no-admission-event/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-event 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-event/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-event/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-event/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/chainsaw-test.yaml index 86ae5fba48..488240ae95 100755 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-report 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml index 86ae5fba48..488240ae95 100755 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/no-admission-report/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: no-admission-report 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/no-admission-report/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/no-admission-report/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/no-admission-report/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/chainsaw-test.yaml index cc1979bf06..5561f8f04b 100755 --- a/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: not-rejected 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/not-rejected-deprecated/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml index cc1979bf06..5561f8f04b 100755 --- a/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml +++ b/test/conformance/chainsaw/background-only/policy/not-rejected/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: not-rejected 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/policy-ready.yaml + with: + bindings: + - name: name + value: validate - name: step-02 try: - apply: diff --git a/test/conformance/chainsaw/background-only/policy/not-rejected/policy-assert.yaml b/test/conformance/chainsaw/background-only/policy/not-rejected/policy-assert.yaml deleted file mode 100644 index d3196721f2..0000000000 --- a/test/conformance/chainsaw/background-only/policy/not-rejected/policy-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: validate -spec: {} -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/webhooks/all-scale/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/all-scale/chainsaw-test.yaml index cf6445e6ee..2ea22e3bb1 100755 --- a/test/conformance/chainsaw/webhooks/all-scale/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/all-scale/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: all-scale 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/all-scale/policy-assert.yaml b/test/conformance/chainsaw/webhooks/all-scale/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/all-scale/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/webhooks/clusterpolicy/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/clusterpolicy/chainsaw-test.yaml index 0a977c385e..2a7be8cc9a 100755 --- a/test/conformance/chainsaw/webhooks/clusterpolicy/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/clusterpolicy/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: clusterpolicy 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/clusterpolicy/policy-assert.yaml b/test/conformance/chainsaw/webhooks/clusterpolicy/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/clusterpolicy/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/webhooks/double-wildcard/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/double-wildcard/chainsaw-test.yaml index 73d814508f..f17d8b161b 100755 --- a/test/conformance/chainsaw/webhooks/double-wildcard/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/double-wildcard/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: double-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: require-labels - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/double-wildcard/policy-assert.yaml b/test/conformance/chainsaw/webhooks/double-wildcard/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/double-wildcard/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/webhooks/dyn-op-mutate-multiple/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/chainsaw-test.yaml index 63db7b54a8..977159166c 100644 --- a/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/chainsaw-test.yaml @@ -5,12 +5,27 @@ metadata: name: dyn-op-mutate-multiple 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: add-apparmor-annotations + - name: wait policy ready + use: + template: ../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: add-annotation - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/policy-assert.yaml b/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/policy-assert.yaml deleted file mode 100644 index 0585d4d294..0000000000 --- a/test/conformance/chainsaw/webhooks/dyn-op-mutate-multiple/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: add-apparmor-annotations -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/webhooks/dyn-op-mutate/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/dyn-op-mutate/chainsaw-test.yaml index fc075ad8f0..83afbbb91d 100644 --- a/test/conformance/chainsaw/webhooks/dyn-op-mutate/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/dyn-op-mutate/chainsaw-test.yaml @@ -5,12 +5,20 @@ metadata: name: dyn-op-mutate 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: add-apparmor-annotations - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/dyn-op-mutate/policy-assert.yaml b/test/conformance/chainsaw/webhooks/dyn-op-mutate/policy-assert.yaml deleted file mode 100644 index 0585d4d294..0000000000 --- a/test/conformance/chainsaw/webhooks/dyn-op-mutate/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: add-apparmor-annotations -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/webhooks/dyn-op-validate/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/dyn-op-validate/chainsaw-test.yaml index 813518f54d..cefbb53972 100644 --- a/test/conformance/chainsaw/webhooks/dyn-op-validate/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/dyn-op-validate/chainsaw-test.yaml @@ -5,12 +5,20 @@ metadata: name: dyn-op-validate 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/dyn-op-validate/policy-assert.yaml b/test/conformance/chainsaw/webhooks/dyn-op-validate/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/dyn-op-validate/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/webhooks/only-pod/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/only-pod/chainsaw-test.yaml index ed8114e58f..cd16d6b727 100755 --- a/test/conformance/chainsaw/webhooks/only-pod/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/only-pod/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: only-pod 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/only-pod/policy-assert.yaml b/test/conformance/chainsaw/webhooks/only-pod/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/only-pod/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/webhooks/pod-all-subresources/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/pod-all-subresources/chainsaw-test.yaml index 1a36acf375..7ad0e31528 100755 --- a/test/conformance/chainsaw/webhooks/pod-all-subresources/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/pod-all-subresources/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pod-all-subresources 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/pod-all-subresources/policy-assert.yaml b/test/conformance/chainsaw/webhooks/pod-all-subresources/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/pod-all-subresources/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/webhooks/pod-exec-subresource/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/pod-exec-subresource/chainsaw-test.yaml index 61a8e44f58..9037cbc6f8 100755 --- a/test/conformance/chainsaw/webhooks/pod-exec-subresource/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/pod-exec-subresource/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: pod-exec-subresource 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: std-shell - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/pod-exec-subresource/policy-assert.yaml b/test/conformance/chainsaw/webhooks/pod-exec-subresource/policy-assert.yaml deleted file mode 100644 index 39d6e7678e..0000000000 --- a/test/conformance/chainsaw/webhooks/pod-exec-subresource/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: ClusterPolicy -metadata: - name: std-shell -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready diff --git a/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/chainsaw-test.yaml index ef7b7b433f..2ad6aec0e4 100755 --- a/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: policy-clusterpolicy-namespaced-clusterscoped-resources spec: steps: - - name: step-01 - try: - - apply: - file: clusterpolicy.yaml - - assert: - file: clusterpolicy-assert.yaml + - name: create policy + use: + template: ../../_step-templates/create-policy.yaml + with: + bindings: + - name: file + value: clusterpolicy.yaml + - name: wait policy ready + use: + template: ../../_step-templates/cluster-policy-ready.yaml + with: + bindings: + - name: name + value: require-labels - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/clusterpolicy-assert.yaml b/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/clusterpolicy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/policy-clusterpolicy-namespaced-clusterscoped-resources/clusterpolicy-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/webhooks/policy-clusterscope-resource/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/policy-clusterscope-resource/chainsaw-test.yaml index 9c2795cb31..6d941558bd 100755 --- a/test/conformance/chainsaw/webhooks/policy-clusterscope-resource/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/policy-clusterscope-resource/chainsaw-test.yaml @@ -7,7 +7,7 @@ spec: - name: step-01 try: - apply: + file: policy.yaml expect: - check: ($error != null): true - file: policy.yaml diff --git a/test/conformance/chainsaw/webhooks/policy-wildcard-resource/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/policy-wildcard-resource/chainsaw-test.yaml index 2d24210f2f..f0316e0fee 100755 --- a/test/conformance/chainsaw/webhooks/policy-wildcard-resource/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/policy-wildcard-resource/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: policy-wildcard-resource 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: - assert: diff --git a/test/conformance/chainsaw/webhooks/policy-wildcard-resource/policy-assert.yaml b/test/conformance/chainsaw/webhooks/policy-wildcard-resource/policy-assert.yaml deleted file mode 100644 index 2993bbaa6e..0000000000 --- a/test/conformance/chainsaw/webhooks/policy-wildcard-resource/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/webhooks/policy/chainsaw-test.yaml b/test/conformance/chainsaw/webhooks/policy/chainsaw-test.yaml index 2b2ed26f19..7d8cbc8a31 100755 --- a/test/conformance/chainsaw/webhooks/policy/chainsaw-test.yaml +++ b/test/conformance/chainsaw/webhooks/policy/chainsaw-test.yaml @@ -4,12 +4,20 @@ metadata: name: policy 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/policy-ready.yaml + with: + bindings: + - name: name + value: require-labels - name: step-02 try: - assert: diff --git a/test/conformance/chainsaw/webhooks/policy/policy-assert.yaml b/test/conformance/chainsaw/webhooks/policy/policy-assert.yaml deleted file mode 100644 index bc25d0fdf8..0000000000 --- a/test/conformance/chainsaw/webhooks/policy/policy-assert.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: kyverno.io/v1 -kind: Policy -metadata: - name: require-labels -status: - conditions: - - reason: Succeeded - status: "True" - type: Ready