From 3b1ce60478893b75a18abf16b2de31f4e1c6a53b Mon Sep 17 00:00:00 2001 From: Mason Malone <651224+MasonM@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:50:56 -0800 Subject: [PATCH] test: more minor cleanup Signed-off-by: Mason Malone <651224+MasonM@users.noreply.github.com> --- .../argo-dangerous-interpolation-vap.yaml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/argo-dangerous-interpolation-vap.yaml b/examples/argo-dangerous-interpolation-vap.yaml index bdc4349e5bcf..caf2b6ba2c42 100644 --- a/examples/argo-dangerous-interpolation-vap.yaml +++ b/examples/argo-dangerous-interpolation-vap.yaml @@ -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('\\{\\{[^\\}]*\\}\\}')) ) )