Skip to content

Commit

Permalink
docs: correctly document result output parameter (#13953)
Browse files Browse the repository at this point in the history
Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM authored Nov 29, 2024
1 parent 1f304ba commit 0aa5e45
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion api/jsonschema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/executor_swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -2462,7 +2462,7 @@ save/load the directory appropriately.
| artifacts | [Artifacts](#artifacts)| `Artifacts` | | | | |
| exitCode | string| `string` | | | ExitCode holds the exit code of a script template | |
| parameters | [][Parameter](#parameter)| `[]*Parameter` | | | Parameters holds the list of output parameters produced by a step</br>+patchStrategy=merge</br>+patchMergeKey=name | |
| result | string| `string` | | | Result holds the result (stdout) of a script template | |
| result | string| `string` | | | Result holds the result (stdout) of a script or container template, or the response body of an HTTP template | |



Expand Down
2 changes: 1 addition & 1 deletion docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ Outputs hold parameters, artifacts, and results from a step
|`artifacts`|`Array<`[`Artifact`](#artifact)`>`|Artifacts holds the list of output artifacts produced by a step|
|`exitCode`|`string`|ExitCode holds the exit code of a script template|
|`parameters`|`Array<`[`Parameter`](#parameter)`>`|Parameters holds the list of output parameters produced by a step|
|`result`|`string`|Result holds the result (stdout) of a script template|
|`result`|`string`|Result holds the result (stdout) of a script or container template, or the response body of an HTTP template|

## SynchronizationStatus

Expand Down
1 change: 1 addition & 0 deletions docs/http-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
> v3.2 and after

`HTTP Template` is a type of template which can execute HTTP Requests.
The body of the response is automatically exported into the `result` output parameter.

```yaml
apiVersion: argoproj.io/v1alpha1
Expand Down
4 changes: 2 additions & 2 deletions docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ sprig.trim(inputs.parameters['my-string-param'])
| `steps.<STEPNAME>.startedAt` | Time-stamp when the step started |
| `steps.<STEPNAME>.finishedAt` | Time-stamp when the step finished |
| `steps.<TASKNAME>.hostNodeName` | Host node where task ran (available from version 3.5) |
| `steps.<STEPNAME>.outputs.result` | Output result of any previous container or script step |
| `steps.<STEPNAME>.outputs.result` | Output result of any previous container, script, or HTTP step |
| `steps.<STEPNAME>.outputs.parameters` | When the previous step uses `withItems` or `withParams`, this contains a JSON array of the output parameter maps of each invocation |
| `steps.<STEPNAME>.outputs.parameters.<NAME>` | Output parameter of any previous step. When the previous step uses `withItems` or `withParams`, this contains a JSON array of the output parameter values of each invocation |
| `steps.<STEPNAME>.outputs.artifacts.<NAME>` | Output artifact of any previous step |
Expand All @@ -163,7 +163,7 @@ sprig.trim(inputs.parameters['my-string-param'])
| `tasks.<TASKNAME>.startedAt` | Time-stamp when the task started |
| `tasks.<TASKNAME>.finishedAt` | Time-stamp when the task finished |
| `tasks.<TASKNAME>.hostNodeName` | Host node where task ran (available from version 3.5) |
| `tasks.<TASKNAME>.outputs.result` | Output result of any previous container or script task |
| `tasks.<TASKNAME>.outputs.result` | Output result of any previous container, script, or HTTP task |
| `tasks.<TASKNAME>.outputs.parameters` | When the previous task uses `withItems` or `withParams`, this contains a JSON array of the output parameter maps of each invocation |
| `tasks.<TASKNAME>.outputs.parameters.<NAME>` | Output parameter of any previous task. When the previous task uses `withItems` or `withParams`, this contains a JSON array of the output parameter values of each invocation |
| `tasks.<TASKNAME>.outputs.artifacts.<NAME>` | Output artifact of any previous task |
Expand Down
8 changes: 6 additions & 2 deletions docs/walk-through/output-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ DAG templates use the tasks prefix to refer to another task, for example `{{task

## `result` output parameter

The `result` output parameter captures standard output.
For script and container templates, the `result` output parameter captures up to 256 kb of the standard output.
For HTTP templates, `result` captures the response body.
It is accessible from the `outputs` map: `outputs.result`.
Only 256 kb of the standard output stream will be captured.

### Scripts

Expand All @@ -59,3 +59,7 @@ Outputs of a `script` are assigned to standard output and captured in the `resul

Container steps and tasks also have their standard output captured in the `result` parameter.
Given a `task`, called `log-int`, `result` would then be accessible as `{{ tasks.log-int.outputs.result }}`. If using [steps](steps.md), substitute `tasks` for `steps`: `{{ steps.log-int.outputs.result }}`.

### HTTP

[HTTP templates](../http-template.md) capture the response body in the `result` parameter if the body is non-empty.
2 changes: 1 addition & 1 deletion pkg/apis/workflow/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/workflow/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/apis/workflow/v1alpha1/workflow_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ type Outputs struct {
// +patchMergeKey=name
Artifacts Artifacts `json:"artifacts,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=artifacts"`

// Result holds the result (stdout) of a script template
// Result holds the result (stdout) of a script or container template, or the response body of an HTTP template
Result *string `json:"result,omitempty" protobuf:"bytes,3,opt,name=result"`

// ExitCode holds the exit code of a script template
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/executor/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ definitions:
$ref: '#/definitions/Parameter'
type: array
result:
description: Result holds the result (stdout) of a script template
description: Result holds the result (stdout) of a script or container template, or the response body of an HTTP template
type: string
type: object
OwnerReference:
Expand Down
2 changes: 1 addition & 1 deletion sdks/java/client/docs/IoArgoprojWorkflowV1alpha1Outputs.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0aa5e45

Please sign in to comment.