Skip to content
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

fix(controller): keep special characters in json string when use withItems #4814

Merged
merged 7 commits into from
Jan 6, 2021

Conversation

cocotyty
Copy link
Contributor

@cocotyty cocotyty commented Dec 31, 2020

Checklist:

https://github.com/argoproj/argo/blob/4eaae251d9147b53604481237732bff36a16a91e/workflow/controller/operator.go#L2729

When WithItems setting a array of object json, and one json field value contains a & or other char which will becomes \uxxxx in json, the value in template execute will be wrong!

For example, my command is curl http://xx/x?a=b&c=d. it will becomes curl http://xx/x?a=b\u0026c=d.

When generate replaceMap , the value is

fmt.Sprintf("%v", itemVal)

https://github.com/argoproj/argo/blob/4eaae251d9147b53604481237732bff36a16a91e/pkg/apis/workflow/v1alpha1/item.go#L67
This must not only remove quote , it must be unmarshal.

@CLAassistant
Copy link

CLAassistant commented Dec 31, 2020

CLA assistant check
All committers have signed the CLA.

@alexec alexec changed the title fix item print problem fix: item print problem Dec 31, 2020
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexec
Copy link
Contributor

alexec commented Dec 31, 2020

Can you please sign-off your commits for the DCO check?

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commits need to be signed-off.

…Items

Signed-off-by: cocotyty <cocotyty@sina.com>
@cocotyty cocotyty changed the title fix: item print problem fix(controller): keep special characters in json string when use withItems Jan 4, 2021
@cocotyty
Copy link
Contributor Author

cocotyty commented Jan 4, 2021

Commits need to be signed-off.

Done.

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexec alexec merged commit adfa988 into argoproj:master Jan 6, 2021
@alexec
Copy link
Contributor

alexec commented Jan 6, 2021

Phew!

@alexec alexec added this to the v3.0 milestone Jan 6, 2021
@simster7 simster7 mentioned this pull request Jan 12, 2021
15 tasks
simster7 pushed a commit that referenced this pull request Jan 12, 2021
…Items (#4814)

Signed-off-by: cocotyty <cocotyty@sina.com>
@simster7
Copy link
Member

Fix for this is out now in https://github.com/argoproj/argo/releases/tag/v2.12.4

alexec added a commit to alexec/argo-workflows that referenced this pull request Feb 10, 2021
…use withItems (argoproj#4814)"

This reverts commit adfa988.

Signed-off-by: Alex Collins <alex_collins@intuit.com>
alexec added a commit that referenced this pull request Feb 11, 2021
…when … … 19da392 …use withItems (#4814)" (#5076)

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@simster7 simster7 mentioned this pull request Feb 16, 2021
33 tasks
simster7 pushed a commit that referenced this pull request Feb 16, 2021
…when … … 19da392 …use withItems (#4814)" (#5076)

Signed-off-by: Alex Collins <alex_collins@intuit.com>
@simster7 simster7 mentioned this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read some symbol encoded when read parameter by loop
4 participants