carvel-dev / ytt

YAML templating tool that works on YAML structure instead of text
https://carvel.dev/ytt
Apache License 2.0
1.63k stars 137 forks source link

Yaml list to comma delimited string #527

Closed ploef closed 2 years ago

ploef commented 2 years ago

Hi,

At the moment I'm investigating if ytt could be the tool to use for yaml templates. Most of the template s working now but I'm struggling with one thing. Does anybody know how to turn a list into a comma delimited string:

e.g. mylist:

should be converted to:

123, 456, 789

pivotaljohn commented 2 years ago

Hey @ploef; welcome!

Glad to hear you're making traction in using ytt. And that you thought to ask for help on this one.

I need to make some guesses as to what you're doing to be helpful. If I'm making an invalid assumptions, please correct me.

I assume

If all that is true, here's a way that I would do that in ytt: https://carvel.dev/ytt/#gist:https://gist.github.com/pivotaljohn/904ca7c7b497549886deff297dcc850d

...

Please also note: you can get responsive support via our Slack channel: Kubernetes#carvel https://kubernetes.slack.com/archives/CH8KCCKA5

If you're not already in the Kubernetes workspace, signup here: https://slack.k8s.io/

ploef commented 2 years ago

Hi @pivotaljohn,

That's exactly what I was looking for! Thanks a lot for the quick response!