-
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
fix: aggregate JSON output parameters correctly #13513
Conversation
49fd22e
to
7a93ed3
Compare
Fixes argoproj#13510 `outputs.result` of a `withItems`/`withParams` will be conditionally `json.Unmarshal`ed. Other output parameters are always json.Unmarshalled, which leads to inconsitency and a complete inability to pass JSON out of withItems outputs straight back in as `withItems` Conditionally unmarshal the outputs.params * avoiding it if the parameter isn't enclosed in `{` or `[`, primarily to avoid bare numbers as they're valid JSON but need quoting here * falling back to old behaviour if this fails Additional e2e test tests the example case. Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
7a93ed3
to
11282dd
Compare
@Joibel is this at all impacted by #12909? Since that creates a diff between Briefly looking at the code, I don't think it does since it only impacts output parameters, but wanted to double check, especially since #12909 (comment) is still incomplete |
Thanks just wanted to make sure!
There were some edge cases there that hadn't been tested (that I had asked tests to be added for), and if those edge cases are impacted, we might want to change the logic. A variable already being JSON or already converted to JSON was one of those, hence my concern here Do you want me to write up an issue to handle the remaining changes to track? I was going to do so if it hadn't been handled soon so that we don't forget about it |
Went ahead and created an issue for it: #13541 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Alan Clucas <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Motivation
Fixes #13510
Modifications
outputs.result
of awithItems
/withParams
will be conditionallyjson.Marshal
ed.Other output parameters are always json.Marshalled, which leads to inconsitency and a complete inability to pass JSON out of withItems outputs straight back in as
withItems
Conditionally Marshal the outputs.params
{
or[
, primarily to avoid bare numbers as they're valid JSON but need quoting hereVerification
Additional e2e test tests the example case.