-
Notifications
You must be signed in to change notification settings - Fork 134
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
Can I add a map to an array of maps? #223
Comments
Hi @amalagaura! Overlays are a great way to patch yaml and can certainly work for your case.
You are really close and only two moves away, all you have to do is remove the If you want the behavior of an |
Awesome thanks! |
I think this example would be great in your overlay playground. Can I just add this in there with a PR or are you planning to do that? |
Hey @amalagaura! We welcome PR's for documentation improvements. So thank you. I took a look at the overlay playground and it looks like there is an append an array item example. The main difference being that the item we are matching in this case is an array item, and in the playground example it's a map. There are a lot of combinations of overlay operations possible, and the two above come together to make a similar solution to the one in this issue. So I think for now, the current examples provide enough to show how to use overlay operations even though some examples may need to be used together. Please let me know if you think there is some aspect that I may be missing here. Thanks |
As a newcomer I went through those examples but I was not able to combine the two examples and get it working on my own. It is up to you but I felt like the example provided above was new to me. I personally think it should be added as an additional example, but it is up to you. |
We definitely want to improve that experience, and would love a PR for this example. If you can create a 16th example in the overlays section that puts matching an array item and appending an array item together that would be helpful. |
I am not sure if this is supported and I am trying different overlay syntax. I am not really able to modify the source yamls so trying to do this with YTT.
So trying to add a map to the reviewers array in both books..
I created a StackOverflow ticket for it.
https://stackoverflow.com/questions/64504795/how-do-i-add-a-map-to-an-array-of-maps-in-ytt
The text was updated successfully, but these errors were encountered: