Skip to content

Commit

Permalink
docs: replace duplicate Expression docs with a link (#11744)
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Gilgur <[email protected]>
(cherry picked from commit d654dc0)
  • Loading branch information
agilgur5 committed May 4, 2024
1 parent c1869ec commit 1ab1d8c
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions docs/conditional-artifacts-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

> v3.1 and after
The Conditional Artifacts and Parameters feature enables to assign the Step/DAG level artifacts or parameters based on
expression. This introduces a new field `fromExpression: ...` under Step/DAG level output artifact and `expression: ...`
under step/DAG level output parameter. Both use the
[expr](https://github.com/antonmedv/expr/blob/master/docs/Language-Definition.md) syntax.
You can set Step/DAG level artifacts or parameters based on an [expression](variables.md#expression).
Use `fromExpression` under a Step/DAG level output artifact and `expression` under a Step/DAG level output parameter.

## Conditional Artifacts

Expand Down Expand Up @@ -51,22 +49,6 @@ under step/DAG level output parameter. Both use the
expression: "steps['flip-coin'].outputs.result == 'heads' ? steps.heads.outputs.result : steps.tails.outputs.result"
```
## Built-In Functions
Convenient functions added to support more use cases:
1. `asInt` - convert the string to integer (e.g: `asInt('1')`)
2. `asFloat` - convert the string to Float (e.g: `asFloat('1.23')`)
3. `string` - convert the int/float to string (e.g: `string(1)`)
4. `jsonpath` - Extract the element from JSON using JSON Path (
e.g: `jsonpath('{"employee":{"name":"sonoo","salary":56000,"married":true}}", "$.employee.name" )` )
5. [Sprig](http://masterminds.github.io/sprig/) - Support all `sprig` functions

!!! NOTE
Expressions will decode the `-` as operator if template name has `-`, it will fail the expression. So here solution
for template name which has `-` in its name. `step['one-two-three'].outputs.artifacts`

* [Steps parameter example](https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/conditional-parameters.yaml)
* [DAG parameter example](https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/dag-conditional-parameters.yaml)
* [Advanced example: fibonacci Sequence](https://raw.githubusercontent.com/argoproj/argo-workflows/main/examples/fibonacci-seq-conditional-param.yaml)

0 comments on commit 1ab1d8c

Please sign in to comment.