Skip to content

Commit 234ce95

Browse files
committed
Updating to use jq filter so we don't get an error when branching
on storage=wanted
1 parent ed3ffc3 commit 234ce95

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

components/site-workflows/sensors/sensor-nova-oslo-event.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ spec:
2828
name: nova-dep
2929
transform:
3030
# the event is a string-ified JSON so we need to decode it
31-
# replace the whole event body
31+
# replace the whole event body and add a storage_wanted flag
3232
jq: |
33-
.body = (.body["oslo.message"] | fromjson)
33+
.body = (.body["oslo.message"] | fromjson) |
34+
.body.storage_wanted = (.body.payload.metadata.storage // "none")
3435
filters:
3536
# applies each of the items in data with 'and'
3637
dataLogicalOperator: "and"
@@ -40,7 +41,7 @@ spec:
4041
value:
4142
- "compute.instance.delete.end"
4243
# Only process if storage was wanted
43-
- path: "body.payload.metadata.storage"
44+
- path: "body.storage_wanted"
4445
type: "string"
4546
value:
4647
- "wanted"

0 commit comments

Comments
 (0)