jos*_*ose 7 kubernetes argoproj argo-workflows
\n\n\n\n
tasks.<TASKNAME>.outputs.parameters: 当上一个任务使用\n\'withItems\' 或 \'withParams\' 时,这包含每个调用的输出\n参数映射的 JSON 数组
当尝试使用以下简单的工作流程时:
\napiVersion: argoproj.io/v1alpha1\nkind: Workflow\nmetadata:\n generateName: test-workflow-\nspec:\n entrypoint: start\n templates:\n - name: start\n dag:\n tasks:\n - name: with-items\n template: hello-letter\n arguments:\n parameters:\n - name: input-letter\n value: "{{item}}"\n withItems:\n - A\n - B\n - C\n - name: show-result\n dependencies:\n - with-items\n template: echo-result\n arguments:\n parameters:\n - name: input\n value: "{{tasks.with-items.outputs.parameters}}"\n\n - name: hello-letter\n inputs:\n parameters:\n - name: input-letter\n outputs:\n parameters:\n - name: output-letter\n value: "{{inputs.parameters.input-letter}}"\n script:\n image: alpine\n command: ["sh"]\n source: |\n echo "{{inputs.parameters.input-letter}}"\n\n - name: echo-result\n inputs:\n parameters:\n - name: input\n outputs:\n parameters:\n - name: output\n value: "{{inputs.parameters.input}}"\n script:\n image: alpine\n command: ["sh"]\n source: |\n echo {{inputs.parameters.input}}\nRun Code Online (Sandbox Code Playgroud)\n我收到以下错误:\nFailed to submit workflow: templates.start.tasks.show-result failed to resolve {{tasks.with-items.outputs.parameters}}
Argo 版本(在 minikube 集群中运行)
\nargo: v2.10.0+195c6d8.dirty\n BuildDate: 2020-08-18T23:06:32Z\n GitCommit: 195c6d8310a70b07043b9df5c988d5a62dafe00d\n GitTreeState: dirty\n GitTag: v2.10.0\n GoVersion: go1.13.4\n Compiler: gc\n Platform: darwin/amd64\nRun Code Online (Sandbox Code Playgroud)\n在 Argo 2.8.1 中出现同样的错误,尽管在显示结果任务中使用.result而不是工作正常(结果是),但在 2.10 中不再工作.parameters[A,B,C]
- name: show-result\n dependencies:\n - with-items\n template: echo-result\n arguments:\n parameters:\n - name: input\n value: "{{tasks.with-items.outputs.result}}"\nRun Code Online (Sandbox Code Playgroud)\n结果:
\nSTEP TEMPLATE PODNAME DURATION MESSAGE\n \xe2\x9a\xa0 test-workflow-parallelism-xngg4 start \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(0:A) hello-letter test-workflow-parallelism-xngg4-3307649634 6s \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(1:B) hello-letter test-workflow-parallelism-xngg4-768315880 7s \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(2:C) hello-letter test-workflow-parallelism-xngg4-2631126026 9s \n \xe2\x94\x94-\xe2\x9a\xa0 show-result echo-result invalid character \'A\' looking for beginning of value\nRun Code Online (Sandbox Code Playgroud)\n我还尝试将显示结果任务更改为:
\n - name: show-result\n dependencies:\n - with-items\n template: echo-result\n arguments:\n parameters:\n - name: input\n value: "{{tasks.with-items.outputs.parameters.output-letter}}"\nRun Code Online (Sandbox Code Playgroud)\n执行没有错误:
\nSTEP TEMPLATE PODNAME DURATION MESSAGE\n \xe2\x9c\x94 test-workflow-parallelism-qvp72 start \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(0:A) hello-letter test-workflow-parallelism-qvp72-4221274474 8s \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(1:B) hello-letter test-workflow-parallelism-qvp72-112866000 9s \n \xe2\x94\x9c-\xe2\x9c\x94 with-items(2:C) hello-letter test-workflow-parallelism-qvp72-1975676146 6s \n \xe2\x94\x94-\xe2\x9c\x94 show-result echo-result test-workflow-parallelism-qvp72-3460867848 3s \nRun Code Online (Sandbox Code Playgroud)\n但参数不被值替换:
\nargo logs test-workflow-parallelism-qvp72\ntest-workflow-parallelism-qvp72-1975676146: 2020-08-25T14:52:50.622496755Z C\ntest-workflow-parallelism-qvp72-4221274474: 2020-08-25T14:52:52.228602517Z A\ntest-workflow-parallelism-qvp72-112866000: 2020-08-25T14:52:53.664320195Z B\ntest-workflow-parallelism-qvp72-3460867848: 2020-08-25T14:52:59.628892135Z {{tasks.with-items.outputs.parameters.output-letter}}\nRun Code Online (Sandbox Code Playgroud)\n我不明白循环的输出会是什么!我错过了什么?有没有办法找出发生了什么?
\n| 归档时间: |
|
| 查看次数: |
1749 次 |
| 最近记录: |