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

Support arbitrary YAML as parameter values #1351

Closed
wants to merge 1 commit into from
Closed

Conversation

nfnt
Copy link
Member

@nfnt nfnt commented Feb 19, 2020

What this PR does / why we need it:
This allow templates to access list or dictionary items if parameter values are provided as valid YAML. Because a simple string is also valid YAML, it is still compatible with regular string values.

Currently WIP, I plan to create a KEP around this as well which will provide more background and motivation.

Fixes #1349

This allow templates to access list or dictionary items if parameter values are provided as valid YAML. Because a simple string is also valid YAML, it is still compatible with regular string values.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt added the WIP label Feb 19, 2020
@nfnt nfnt self-assigned this Feb 19, 2020
@nfnt
Copy link
Member Author

nfnt commented Feb 19, 2020

It's not that easy :(
Template functions like eq now fail because it's no longer a string-string comparison.

@porridge
Copy link
Member

Also, I suspect passing valid non-trivial YAML as value of the -p command line option will not exactly be easy...

@nfnt
Copy link
Member Author

nfnt commented Feb 24, 2020

@porridge, I agree, my main focus wasn't -p just yet.

eq fails because by treating everything as YAML, unmarshalling converts some types. E.g., the input string "true" is converted to a boolean. The eq comparison expects to compare a string with a string and fails because it's now comparing a bool with a string.

@nfnt
Copy link
Member Author

nfnt commented Feb 25, 2020

Closing, as this is superseded by KEP-24.

@nfnt nfnt closed this Feb 25, 2020
@nfnt nfnt deleted the nfnt/yaml-in-params branch July 23, 2020 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide a template function to create dictionaries from YAML values
2 participants