Skip to content

Commit 5b49927

Browse files
jswxstwoninowang
authored andcommitted
fix: add archive location if artifact is needed in data source. Fixes #14990
Signed-off-by: oninowang <[email protected]>
1 parent 5291e0b commit 5b49927

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

docs/fields.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,8 +2054,6 @@ Outputs hold parameters, artifacts, and results from a step
20542054

20552055
- [`dag-conditional-parameters.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/dag-conditional-parameters.yaml)
20562056

2057-
- [`data-transformations.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/data-transformations.yaml)
2058-
20592057
- [`exit-handler-with-artifacts.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/exit-handler-with-artifacts.yaml)
20602058

20612059
- [`exit-handler-with-param.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/exit-handler-with-param.yaml)

examples/data-transformations.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ spec:
3838

3939
transformation:
4040
- expression: "filter(data, {# endsWith \"main.log\"})"
41-
outputs:
42-
artifacts:
43-
- name: file
44-
path: /file
4541

4642
- name: process-logs
4743
inputs:

workflow/controller/workflowpod.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,13 @@ func (woc *wfOperationCtx) addArchiveLocation(ctx context.Context, tmpl *wfv1.Te
12051205
}
12061206
archiveLogs := woc.IsArchiveLogs(tmpl)
12071207
needLocation := archiveLogs
1208-
for _, art := range append(tmpl.Inputs.Artifacts, tmpl.Outputs.Artifacts...) {
1208+
artifacts := append(tmpl.Inputs.Artifacts, tmpl.Outputs.Artifacts...)
1209+
if tmpl.Data != nil {
1210+
if art, exist := tmpl.Data.Source.GetArtifactIfNeeded(); exist {
1211+
artifacts = append(artifacts, *art)
1212+
}
1213+
}
1214+
for _, art := range artifacts {
12091215
if !art.HasLocation() {
12101216
needLocation = true
12111217
}

0 commit comments

Comments
 (0)