Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions docs/cel_expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ interceptors:
- ref:
name: cel
params:
- name: overlays:
- name: overlays
value:
- key: count_plus_1
expression: "body.count + 1.0"
- key: count_plus_2
Expand Down Expand Up @@ -90,8 +91,8 @@ interceptors:
- ref:
name: cel
params:
- name: overlays:
values:
- name: overlays
value:
- key: bad_measure_times_3
expression: "body.measure * 3"
```
Expand Down Expand Up @@ -132,15 +133,17 @@ You can use this in filters in the following ways:

You can also parse additional data from each of the labels:
```yaml
overlays:
- key: suffixes
expression: "body.labels.map(x, x.name.substring(x.name.lastIndexOf('-')+1))"
- name: overlays
value:
- key: suffixes
expression: "body.labels.map(x, x.name.substring(x.name.lastIndexOf('-')+1))"
```
This yields an array of `["a", "b"]` in the `suffixes` extension key.
```yaml
overlays:
- key: filtered
expression: "body.labels.filter(x, x.name.endsWith('-b'))"
- name: overlays
value:
- key: filtered
expression: "body.labels.filter(x, x.name.endsWith('-b'))"
```
This would add an extensions key `filtered` with only one of the labels.
```yaml
Expand Down Expand Up @@ -183,8 +186,11 @@ you will need to explicitly convert it to a CEL string.

```yaml
interceptors:
- cel:
overlays:
- ref:
name: "cel"
params:
- name: "overlays"
value:
- key: base64_decoded
expression: "string(base64.decode(body.b64Value))"
```
Expand Down Expand Up @@ -340,7 +346,7 @@ interceptor.
</tr>
<tr>
<th>
decodeb64 **deprecated: please use base64.decode**
decodeb64 <b>deprecated: please use base64.decode</b>
</th>
<td>
<pre>&lt;string&gt;.decodeb64() -> string</pre>
Expand Down
4 changes: 2 additions & 2 deletions docs/eventlisteners.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Below is an example `Trigger` definition that embeds a `triggerTemplate` definit
triggers:
- name: "my-trigger"
template:
spec:
spec:
params:
- name: "my-param-name"
resourceTemplates:
Expand Down Expand Up @@ -332,7 +332,7 @@ spec:
servicePort: 8128
```

If you use a loadbalancer service, you can optionally define a (LoadBalancerClass)[https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class] with the `ServiceLoadBalancerClass` attribute.
If you use a loadbalancer service, you can optionally define a [LoadBalancerClass](https://kubernetes.io/docs/concepts/services-networking/service/#load-balancer-class) with the `ServiceLoadBalancerClass` attribute.
```yaml
spec:
resources:
Expand Down