Skip to content

Commit

Permalink
test: more minor cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM committed Jan 11, 2025
1 parent d7cf331 commit 3b1ce60
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions examples/argo-dangerous-interpolation-vap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ spec:
resources: ["workflows"]
validations:
- expression: |
!object.spec.templates.map(template,
!object.spec.templates.exists(template,
// Aggregate all command/args/source fields for all containers into a 2D array,
// since CEL doesn't support array flattening.
// For "container" and "script" templates, there's only one container,
// so the first array will have a single entry.
// For "containerSet" templates, the first array could have many entries.
[
template.?container.command.orValue([])
+ template.?container.args.orValue([])
+ template.?script.command.orValue([])
+ [template.?script.source.orValue("")]
]
+ template.?containerSet.optMap(containerSet,
containerSet.containers.map(c, c.?command.orValue([]) + c.?args.orValue([]))
).orValue([])
).exists(templateValues,
templateValues.exists(containerValues,
(
[ template.?container.command.orValue([])
+ template.?container.args.orValue([])
+ template.?script.command.orValue([])
+ [template.?script.source.orValue("")]
] + template.?containerSet.optMap(containerSet,
containerSet.containers.map(c,
c.?command.orValue([]) + c.?args.orValue([])
)
).orValue([])
).exists(containerValues,
containerValues.exists(value, value.matches('\\{\\{[^\\}]*\\}\\}'))
)
)
Expand Down

0 comments on commit 3b1ce60

Please sign in to comment.