Skip to content

Commit fdda054

Browse files
danielfbmtekton-robot
authored andcommitted
Fixes more cel interceptor usage syntax in cel_expressions.md
1 parent f151b59 commit fdda054

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

docs/cel_expressions.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ interceptors:
6363
name: cel
6464
params:
6565
- name: overlays
66-
values:
66+
value:
6767
- key: count_plus_1
6868
expression: "body.count + 1.0"
6969
- key: count_plus_2
@@ -91,8 +91,8 @@ interceptors:
9191
- ref:
9292
name: cel
9393
params:
94-
- name: overlays:
95-
values:
94+
- name: overlays
95+
value:
9696
- key: bad_measure_times_3
9797
expression: "body.measure * 3"
9898
```
@@ -133,15 +133,17 @@ You can use this in filters in the following ways:
133133

134134
You can also parse additional data from each of the labels:
135135
```yaml
136-
overlays:
137-
- key: suffixes
138-
expression: "body.labels.map(x, x.name.substring(x.name.lastIndexOf('-')+1))"
136+
- name: overlays
137+
value:
138+
- key: suffixes
139+
expression: "body.labels.map(x, x.name.substring(x.name.lastIndexOf('-')+1))"
139140
```
140141
This yields an array of `["a", "b"]` in the `suffixes` extension key.
141142
```yaml
142-
overlays:
143-
- key: filtered
144-
expression: "body.labels.filter(x, x.name.endsWith('-b'))"
143+
- name: overlays
144+
value:
145+
- key: filtered
146+
expression: "body.labels.filter(x, x.name.endsWith('-b'))"
145147
```
146148
This would add an extensions key `filtered` with only one of the labels.
147149
```yaml
@@ -184,8 +186,11 @@ you will need to explicitly convert it to a CEL string.
184186

185187
```yaml
186188
interceptors:
187-
- cel:
188-
overlays:
189+
- ref:
190+
name: "cel"
191+
params:
192+
- name: "overlays"
193+
value:
189194
- key: base64_decoded
190195
expression: "string(base64.decode(body.b64Value))"
191196
```

0 commit comments

Comments
 (0)