diff --git a/testdata/e2e/config.yaml b/testdata/e2e/config.yaml index f09528a82..839a0c3cd 100644 --- a/testdata/e2e/config.yaml +++ b/testdata/e2e/config.yaml @@ -15,4 +15,4 @@ spec: template: metadata: annotations: - from-config-file: ("hello") + from-config-file: (string("hello")) diff --git a/testdata/e2e/examples/CATALOG.md b/testdata/e2e/examples/CATALOG.md index 4c995f1ae..d688c2737 100644 --- a/testdata/e2e/examples/CATALOG.md +++ b/testdata/e2e/examples/CATALOG.md @@ -7,6 +7,7 @@ - [basic](basic/README.md) - [bindings](bindings/README.md) - [catch](catch/README.md) +- [cel](cel/README.md) - [command-output](command-output/README.md) - [delete](delete/README.md) - [delete](delete/README.md) diff --git a/testdata/e2e/examples/cel/README.md b/testdata/e2e/examples/cel/README.md new file mode 100644 index 000000000..9a8eda7f2 --- /dev/null +++ b/testdata/e2e/examples/cel/README.md @@ -0,0 +1,51 @@ +# Test: `cel` + +*No description* + +## Bindings + +| # | Name | Value | +|:-:|---|---| +| 1 | `a` | 1 | + +## Steps + +| # | Name | Bindings | Try | Catch | Finally | Cleanup | +|:-:|---|:-:|:-:|:-:|:-:| +| 1 | [step-1](#step-step-1) | 1 | 1 | 0 | 0 | 0 | +| 2 | [step-2](#step-step-2) | 1 | 1 | 0 | 0 | 0 | + +### Step: `step-1` + +*No description* + +#### Bindings + +| # | Name | Value | +|:-:|---|---| +| 1 | `b` | 2 | + +#### Try + +| # | Operation | Bindings | Outputs | Description | +|:-:|---|:-:|:-:|---| +| 1 | `apply` | 1 | 0 | *No description* | + +### Step: `step-2` + +*No description* + +#### Bindings + +| # | Name | Value | +|:-:|---|---| +| 1 | `b` | 2 | + +#### Try + +| # | Operation | Bindings | Outputs | Description | +|:-:|---|:-:|:-:|---| +| 1 | `assert` | 1 | 0 | *No description* | + +--- + diff --git a/testdata/e2e/examples/cel/chainsaw-test.yaml b/testdata/e2e/examples/cel/chainsaw-test.yaml new file mode 100644 index 000000000..1ef65ef16 --- /dev/null +++ b/testdata/e2e/examples/cel/chainsaw-test.yaml @@ -0,0 +1,47 @@ +# yaml-language-server: $schema=../../../../.schemas/json/test-chainsaw-v1alpha1.json +apiVersion: chainsaw.kyverno.io/v1alpha1 +kind: Test +metadata: + name: cel +spec: + bindings: + - name: a + value: 1 + steps: + - bindings: + - name: b + value: 2 + try: + - compiler: cel + apply: + template: true + bindings: + - name: c + value: (string(bindings.resolve("a") + bindings.resolve("b"))) + resource: + apiVersion: v1 + kind: ConfigMap + metadata: + name: quick-start + data: + cel: (cel; bindings.resolve("c")) + jp: (jp; $c) + default: (bindings.resolve("c")) + - bindings: + - name: b + value: 2 + try: + - assert: + bindings: + - name: c + compiler: cel + value: (string(bindings.resolve("a") + bindings.resolve("b"))) + resource: + apiVersion: v1 + kind: ConfigMap + metadata: + name: quick-start + data: + cel: (cel; bindings.resolve("c")) + jp: (jp; $c) + default: ($c)