-
Notifications
You must be signed in to change notification settings - Fork 136
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
Overlaying list on schema renders incorrectly #912
Comments
https://carvel.dev/ytt/#gist:https://gist.github.com/prembhaskal/626f1264d3ab6783d7c42ccf92eaeafd added a gist for simpler reproducing of issue. |
few more illustrating similar issues
|
@henry-spanka You can update your #@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.all
---
apps:
#@overlay/match by=overlay.all, expects="1+"
- vars:
- var1
Now if you run apps:
- name: app1
vars:
- var1
- name: app2
vars:
- var1 (The need to use ytt twice is because you don't have a config to load the data values and you are using data-values-inspect) |
While this might work you lose schema validation by piping the ytt output to a new invocation of ytt. What I actually want is to overwrite values of data values with overlays while still keeping data types and validation. This works perfectly so far except the issue I described. I don't really think this is expected behaviour. |
Could you elaborate your use case a little bit. Data values are a way for authors to allow their consumers to easily configure things (templating). While overlays provide a way for the consumers to update something that is not made configurable by the authors (not templated). |
Hi, I want to have default values and then override them in an environment specific values file. Ytt by default only merges keys, however I want to modify lists and work with overlays. This works well in 99% of cases but when overlaying lists of lists or dict of list it breaks with some weird behaviour (as explained before). |
What steps did you take:
I expect b.yaml to append item "var1" to vars list in each app. However the item is appended twice (or more depending on how many items are in apps).
schema.yaml
a.yaml
b.yaml
What happened:
"var1" is appended to each vars list twice.
What did you expect:
"var1" appended once to vars list.
Anything else you would like to add:
Setting vars to an empty list in a.yaml explicitly resolves this issue, however it's not the same semantically (default value from schema file gets lost).
Additionally, defining b.yaml as following to only match on name=app1, appends item to every list item (behaving like overlay.all).
Environment:
ytt --version
):ytt version 0.49.0
/etc/os-release
):macOS 14.4.1 M1
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: