-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.10.0-rc4 nested maps in loop rendered as Golang map[] #3653
Comments
metadata:
name: nested-test-dzzj8
generateName: nested-test-
namespace: argo
selfLink: /apis/argoproj.io/v1alpha1/namespaces/argo/workflows/nested-test-dzzj8
uid: fda9ecc9-1a7a-4e17-be3a-cfe09247ae7f
resourceVersion: '61786'
generation: 6
creationTimestamp: '2020-07-31T19:14:57Z'
labels:
workflows.argoproj.io/completed: 'true'
workflows.argoproj.io/creator: admin
workflows.argoproj.io/phase: Succeeded
spec:
templates:
- name: main
arguments: {}
inputs:
parameters:
- name: things
value: '[{"nested": {"B": "2 \"foo\""}}]'
outputs: {}
metadata: {}
steps:
- - name: echoitems
template: echo
arguments:
parameters:
- name: thing
value: '{{item.nested}}'
withParam: '{{inputs.parameters.things}}'
- name: echo
arguments: {}
inputs:
parameters:
- name: thing
outputs: {}
metadata: {}
container:
name: ''
image: busybox
command:
- echo
args:
- '{{inputs.parameters.thing}}'
resources: {}
entrypoint: main
arguments: {}
status:
phase: Succeeded
startedAt: '2020-07-31T19:14:57Z'
finishedAt: '2020-07-31T19:15:06Z'
nodes:
nested-test-dzzj8:
id: nested-test-dzzj8
name: nested-test-dzzj8
displayName: nested-test-dzzj8
type: Steps
templateName: main
templateScope: local/nested-test-dzzj8
phase: Succeeded
startedAt: '2020-07-31T19:14:57Z'
finishedAt: '2020-07-31T19:15:06Z'
inputs:
parameters:
- name: things
value: '[{"nested": {"B": "2 \"foo\""}}]'
children:
- nested-test-dzzj8-4277542052
outboundNodes:
- nested-test-dzzj8-3548477305
nested-test-dzzj8-3548477305:
id: nested-test-dzzj8-3548477305
name: 'nested-test-dzzj8[0].echoitems(0:nested:map[B:2 "foo"])'
displayName: 'echoitems(0:nested:map[B:2 "foo"])'
type: Pod
templateName: echo
templateScope: local/nested-test-dzzj8
phase: Succeeded
boundaryID: nested-test-dzzj8
startedAt: '2020-07-31T19:14:57Z'
finishedAt: '2020-07-31T19:15:02Z'
resourcesDuration:
cpu: 4
memory: 2
inputs:
parameters:
- name: thing
value: 'map[B:2 "foo"]'
outputs:
artifacts:
- name: main-logs
archiveLogs: true
s3:
endpoint: 'minio:9000'
bucket: my-bucket
insecure: true
accessKeySecret:
name: my-minio-cred
key: accesskey
secretKeySecret:
name: my-minio-cred
key: secretkey
key: nested-test-dzzj8/nested-test-dzzj8-3548477305/main.log
exitCode: '0'
hostNodeName: k3d-k3s-default-server
nested-test-dzzj8-4277542052:
id: nested-test-dzzj8-4277542052
name: 'nested-test-dzzj8[0]'
displayName: '[0]'
type: StepGroup
templateName: main
templateScope: local/nested-test-dzzj8
phase: Succeeded
boundaryID: nested-test-dzzj8
startedAt: '2020-07-31T19:14:57Z'
finishedAt: '2020-07-31T19:15:06Z'
children:
- nested-test-dzzj8-3548477305
conditions:
- type: Completed
status: 'True'
resourcesDuration:
cpu: 4
memory: 2
|
@tanenbaum could you please add some detail on how you are impacted please? |
This would be helpful, the string you pointed out is only used as part of the generated task name, it should have no bearing on the rest of the Workflow execution. |
I think my title and initial bits are misleading. Not only is it rendered as a map[] in the task name, that's what is passed into the job too. From the above logs:
This breaks a few of my workflows where I have nested JSON maps inside lists that are enumerated via |
Let's try a more explicit example, where the template will parse the JSON before logging out:
In 2.9.4 this works fine:
In 2.10.0-rc4 the
|
Looking into this |
@tanenbaum I see what the issue is here. The whole variable is getting mapped to a Go value, not just the name of the task. This is certainly a bug, thank you for reporting. @alexec may I fix this? |
Ah - just changed in #3659 . |
Fixed and available in v2.10.0-rc5. |
Checklist:
What happened:
Using v2.10.0, when looping over a JSON list with nested object with
withParam
, references to nested JSON objects results in a Golang style map%v
string rather than the nested JSON.What you expected to happen:
Nested maps should remain the same as the input structure, escaped in the same way as referenced in #3409 (appears mostly fixed in 2.10.x).
How to reproduce it (as minimally and precisely as possible):
Using following workflow:
Using
./tools/argo/argov2.10.0-rc4 submit nested-test.yaml --watch
And, showing the workflow logs:
In 2.9.4 I get the expected behaviour:
Anything else we need to know?:
Environment:
Other debugging information (if applicable):
Message from the maintainers:
If you are impacted by this bug please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.
The text was updated successfully, but these errors were encountered: